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, 2567🔥, 0💬
Popular Posts:
Where to find reference information and tutorials on MySQL database functions? I want to know how to...
How To Get the Definition of a View Out of the SQL Server in SQL Server? If you want get the definit...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
What Happens to an Arithmetic Operation with Two Different Data Types in SQL Server Transact-SQL? Wh...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...