
When there are more than one student got the same mark ( say 88 ) then the names of them will be listed alphabetically. This will list on ascending order of mark. SELECT * FROM student ORDER BY mark, name We can display list of students based on their mark and based on their name. SELECT * FROM `student` ORDER BY class desc Order by more than one column of a table We have to add desc to the ORDER BY clause. Reverse the order by specifying in our sql command to change the order toĭescending that is from Z to A. Here the records are returned in the order by class from A to Z. SELECT * FROM `student` ORDER BY class id Here is the command to display the records in the order of class Read how Order by command is used to display highest 3 records of student table order by on a varchar field SELECT * FROM `student` ORDER BY class desc, mark desc id
VALENTINA STUDIO DISPLY MORE THAN 100 ENTRIES FULL
Will give a highly use full way by displaying all the records in order of class Here is the code toĭisplay the records in the order of class and then in the order of marks. To display the records in order of mark in aĬlass, we have to use to field names in the order by clause. Here the total mark will be displayed in the order of highest to lowest andĬlass will not be considered. SELECT * FROM `student` ORDER BY mark desc Here is the command to display the records in descending order ( from highest to Please note that by default all order by commands are in ascending order only. Lowest mark to highest mark by using the ASC command ( ascending command )

We can apply this to our numeric field mark to display the list in order of Order by MySQL query to display rows based on order of columns
