![]() |
||||||||||||||||||
| Home --- Topics --- Articles --- Forum --- Offers --- Register --- Contact us | ||||||||||||||||||
|
|
||||||||||||||||||
|
Did you know? if you register at Hamid School you can save up to 45% on hosting packages offered by Surreyhost.com . Don't miss out, every minute counts! Are you Confused? Click here to learn how to use hamid school PHP MySQL Order By KeywordThe ORDER BY keyword is used to sort the data in a recordset. The ORDER BY KeywordThe ORDER BY keyword is used to sort the data in a recordset. Syntax
Note: SQL statements are not case sensitive. ORDER BY is the same as order by. ExampleThe following example selects all the data stored in the "Person" table, and sorts the result by the "Age" column:
The output of the code above will be:
Sort Ascending or DescendingIf you use the ORDER BY keyword, the sort-order of the recordset is ascending by default (1 before 9 and "a" before "p"). Use the DESC keyword to specify a descending sort-order (9 before 1 and "p" before "a"):
Order by Two ColumnsIt is possible to order by more than one column. When ordering by more than one column, the second column is only used if the values in the first column are identical:
Viewed:80
Did you know? if you register at Hamid School you can learn web programming and designing for free and also you can save up to 45% on hosting packages offered by Surreyhost.com . Don't miss out, every minute counts!
|
|
|||||||||||||||||
|
Sponsored by: Surreyhost.com Coded and designed by: Hamid Moudi HPLA |
||||||||||||||||||