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, 2855🔥, 0💬
Popular Posts:
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...
What Are the Differences between DATE and TIMESTAMP in Oracle? The main differences between DATE and...
How to check if two JSON values have overlaps using the JSON_OVERLAPS() function? JSON_OVERLAPS(json...
How To Look at the Current SQL*Plus System Settings in Oracle? If you want to see the current values...
Collections: Interview Questions MySQL Tutorials MySQL Functions Oracle Tutorials SQL Server Tutoria...