SQL ORDER BY clause is used for sorting the data in ascending or descending order, if we don’t specify anything then data sorted by ascending order by default.
Select Col1,Col2, Col3 from table_name order by column_name
Select firstName, lastNmae, DOB, Mobile, Address from tbStudent order by firstName
You also can use more than one column in order by statement
Select firstName, lastNmae, DOB, Mobile, Address from tbStudent Order by firstName, DOB
Select firstName, lastNmae, DOB, Mobile, Address from tbStudent Order by firstName DESC
You can write customized order statement with help of CASE statement, Notice order by ASC and DESC in same place
Select * from tbContactList ORDER BY (CASE City WHEN 'Mumbai' THEN 1 WHEN 'Navi Mumbai' THEN 2 WHEN 'Delhi' THEN 3 WHEN 'New Delhi' THEN 4 WHEN 'Hyderabad/ Secunderabad' THEN 5 ELSE 100 END) ASC, City DESC;