Beginning SQL

Beginning SQL Beginning SQL

marjan.fesb.hr
from marjan.fesb.hr More from this publisher
20.07.2013 Views

Chapter 3 76 YearReleased 1947 1967 1967 1967 1975 1977 1980 1984 1987 1988 1989 1989 1997 2001 2005 If you require descending order, however, you must add DESC after the list of columns in the ORDER BY clause: SELECT YearReleased FROM Films ORDER BY YearReleased DESC; If you execute the preceding SELECT statement, the results are displayed from highest to lowest number, as shown in the following table: YearReleased 2005 2001 1997 1989 1989 1988 1987

Chapter 3<br />

76<br />

YearReleased<br />

1947<br />

1967<br />

1967<br />

1967<br />

1975<br />

1977<br />

1980<br />

1984<br />

1987<br />

1988<br />

1989<br />

1989<br />

1997<br />

2001<br />

2005<br />

If you require descending order, however, you must add DESC after the list of columns in the ORDER BY<br />

clause:<br />

SELECT YearReleased<br />

FROM Films<br />

ORDER BY YearReleased DESC;<br />

If you execute the preceding SELECT statement, the results are displayed from highest to lowest number,<br />

as shown in the following table:<br />

YearReleased<br />

2005<br />

2001<br />

1997<br />

1989<br />

1989<br />

1988<br />

1987

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!