Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql 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

multiple order by sql

SELECT * FROM People ORDER BY FirstName DESC, YearOfBirth ASC
Comment

multiple order by sql

ORDER BY column1 DESC, column2
Comment

SQL ORDER BY With Multiple Columns

SELECT *
FROM Customers
ORDER BY first_name, age;
Comment

PREVIOUS NEXT
Code Example
Sql :: decimal() mysql 
Sql :: oracle get foreign keys on table 
Sql :: what is non relational database 
Sql :: mysql switch case 
Sql :: mysql server not running 
Sql :: how to delete user sql server 
Sql :: ImportError: DLL load failed while importing _sqlite3: The specified module could not be found. 
Sql :: mysql is odd 
Sql :: Mysql table variables 
Sql :: date in mysql 
Sql :: unique element in sql 
Sql :: postgres get last value 
Sql :: microsoft sql server python connection 
Sql :: postgres copy command 
Sql :: how to start with sql 
Sql :: drop database mysql 
Sql :: insert or update sql query 
Sql :: forgot postgres password 
Sql :: trigger sql 
Sql :: how to add more columns to a table in mysql 
Sql :: what is delete in sql 
Sql :: insert using condition postgres 
Sql :: collation in sql 
Sql :: Write an SQL query to fetch the count of employees working in the department ‘Admin’. 
Sql :: triggers in mysql example 
Sql :: To log postgres db in without a password 
Sql :: keep getting an error when I try to connect to mysql workbench 
Sql :: List MySQL Table and Index Size 
Sql :: sql creating tables 
Sql :: long string type sql 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =