Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Name Query Output Columns
How To Name Query Output Columns? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries
✍: 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)
2007-05-11, 4779👍, 0💬
Popular Posts:
what is a service contract, operation contract and Data Contract? - part 1 In the below sample we ha...
How can I include comments in HTML? An HTML comment begins with "<!--", ends with "-->...
Rachel opened her math book and found that the sum of the facing pages was 245. What pages did she o...
Do You Know the Book "JUnit in Action"? You should know this book. It received some good reviews. Ti...
What Is a CAPTION Tag/Element? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells A "capti...