1. ORDER BY column_name ASC
2. ORDER BY column_name DESC
3. ORDER BY RAND().
1. ORDER BY column_name ASC is order by ascending.
2. ORDER BY column_name DESC is order results by descending.
3. ORDE BY RAND() is order results by random.
Syntax
"SELECT column_name FROM table_name ORDER BY column_name ASC";or
"SELECT column_name FROM table_name";
- This will select the records from mysql by ascending (ascending is the default value).
"SELECT column_name FROM table_name ORDER BY column_name DESC";
- This will select the records from mysql by descending
"SELECT column_name FROM table_name ORDER BY RAND()";
- This will select the records from mysql by random
Example Order by Ascending
No comments:
Post a Comment