Collections:
Assign Names to Query Output Columns in MySQL
How To Name Query Output Columns in MySQL?
✍: FYIcenter.com
Each column in the query output has a default name. If you don't like the default name, you can specify a new name for any column in the query output by using the AS clause. The following statement shows you a good example:
mysql> SELECT tag AS Category, YEAR(created) AS Year, COUNT(*) AS Counts FROM fyi_links GROUP BY tag, YEAR(created) ORDER BY COUNT(*) DESC; +----------+------+--------+ | Category | Year | Counts | +----------+------+--------+ | DBA | 2006 | 2 | | DEV | 2006 | 1 | | SQA | 2006 | 1 | | DBA | 2005 | 1 | | DEV | 2004 | 1 | | SQA | 2003 | 1 | +----------+------+--------+ 6 rows in set (0.00 sec)
⇐ Inner Join with the WHERE Clause in MySQL
2017-09-28, 3094🔥, 0💬
Popular Posts:
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...
How to set the current database in SQL Server? Once you are connected to the SQL Server, you should ...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers ...
How To Verify Your PHP Installation in MySQL? PHP provides two execution interfaces: Command Line In...