Answers for "sort by column sql"

SQL
5

how to sort names in alphabetical order in sql

SELECT id,  
    first_name,
    last_name, 
  FROM customer
  ORDER BY last_name ASC;
Posted by: Guest on December-21-2020
4

sort by sql

SELECT * FROM table_name ORDER BY col1 ASC;				-- ASCending is default
SELECT * FROM table_name ORDER BY col1 DESC;			-- DESCending
SELECT * FROM table_name ORDER BY col1 DESC, col2;	 	-- col1 DESC then col2 ASC
Posted by: Guest on May-09-2021
4

order by sql

//this_for_descending_order.. 
 SELECT * FROM TableName ORDER BY columnName DESC;
 // this_for_ascending_order..
SELECT * FROM TableName ORDER BY columnName ASC;
Posted by: Guest on October-02-2020
0

order by in sql

ORDER BY: is for sorting result
either in descending or ascending order.
Posted by: Guest on January-07-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language