Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql order by multiple columns

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

MySQL Order Two Columns

SELECT * FROM demo ORDER BY Hint DESC, Name
Comment

PREVIOUS NEXT
Code Example
Sql :: division by zero postgres 
Sql :: mysql count multiple columns in one query 
Sql :: find usage of table in sql server 
Sql :: convert polygon to text in mysql 
Sql :: if column value is null then in mysql 
Sql :: get cpu details sql 
Sql :: row to json in sql server 
Sql :: sql currency format 
Sql :: get max salary from each department sql 
Sql :: 11:04:35 PM [mysql] Error: MySQL shutdown unexpectedly. 11:04:35 PM [mysql] This may be due to a blocked port, missing dependencies, 
Sql :: drop CHECK constraint sql 
Sql :: create temporary table sql 
Sql :: oracle dba_dependencies 
Sql :: sql not in 
Sql :: if mysql 
Sql :: sqlalchemy empty table 
Sql :: t_sql contains 
Sql :: change column name mysql 
Sql :: sql select date add day 
Sql :: oracle concat datetime 
Sql :: sql oracle update multiple rows 
Sql :: create table mysql integer NOT null 
Sql :: SQL Subtraction Operator 
Sql :: sqlite insert if not exists 
Sql :: stuff sql server 
Sql :: check for directory in bash 
Sql :: how to get all dates in a month in oracle 
Sql :: Add new column T-SQL 
Sql :: increment id in mysql 
Sql :: how to import mysql database command line 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =