I have table named usertable and structure is
id Name Year
==========================
1 a 2010
____________________________
2 b 2008
____________________________
3 c 2010
____________________________
4 d 2007
____________开发者_C百科________________
5 e 2008
Now I want the Output result like this
Year
==========
2010
____________
2008
____________
2007
I don't know the SQL query .
So please help me.
Every Ideas and suggestions are welcome.
Not exactly sure what you're looking for, but if you're looking for the years that are in the table in descending order, then you could use this:
SELECT DISTINCT year FROM usertable ORDER BY year DESC;
SELECT DISTINCT [Year]
FROM myTable
ORDER BY [Year] DESC
SELECT DISTINCT Year
FROM MyTable
ORDER BY Year DESC
SELECT DISTINCT Year
FROM TABLE
ORDER BY Year DESC
if you wan't to be more than tape monkey here's a brilliant hands on source http://sqlzoo.net/0.htm
精彩评论