Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql order by two columns priority

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
Comment

PREVIOUS NEXT
Code Example
Sql :: set value to null sql 
Sql :: how to set a column as unique in sql server 
Sql :: mysql delete rows 
Sql :: mysql remove records 
Sql :: grant all privileges microsoft sql 
Sql :: query by column for substring sql 
Sql :: mysql select distinct date from timestamp 
Sql :: restart serial number for postgres 
Sql :: oracle array 
Sql :: mysql date format 
Sql :: importing excel data into sql server 
Sql :: sql select min row 
Sql :: object dependencies in oracle 
Sql :: sub query in linq 
Sql :: view table sql 
Sql :: mysql not defined 
Sql :: pl sql 
Sql :: encrypt and decrypt in sql server 
Sql :: into sql 
Sql :: mysql connectiion timeout 
Sql :: sql 2nd highest salary 
Sql :: postgres data location 
Sql :: Upgrading postgresql data from 13 to 14 failed! 
Sql :: how to truncate foreign key constraint table 
Sql :: warning: mysqli::__construct(): (hy000/2002): 
Sql :: functions with parameters SQL 
Sql :: oracle generate list of dates in between a date range 
Sql :: update value sql 
Sql :: how to get parent and child record in single query using sql 
Sql :: truckat table mysql 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =