Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql sort descending

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 ASC;	-- col1 DESC then col2 ASC
Comment

mysql order

SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC|DESC 
Comment

ascending order mysql

  
 SELECT 
   column_name1, column_name2, column_name3
FROM 
   table_name
ORDER BY 
   column_name1 [ASC|DESC], 
   column_name2 [ASC|DESC],
   ...;
Comment

sort by mysql

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 by

To get the sorted result from MySQL select statement we use order by clause with SELECT statement.

Syntax:
SELECT column_list FROM tablename ORDER BY column_name1 [ASC][DESC],column_name2 [ASC][DESC],...
Comment

MySQL ORDER BY

SELECT 
   select_list
FROM 
   table_name
ORDER BY 
   column1 [ASC|DESC], 
   column2 [ASC|DESC],
   ...;
Comment

MYSQL ORDER BY

SELECT * FROM adminra_RepAda.customerServiceRequests order by insertDate DESC;
Comment

MySQL Order By

SELECT * FROM demo ORDER BY Hint
Comment

PREVIOUS NEXT
Code Example
Sql :: create database sql 
Sql :: oracle select first row order by 
Sql :: sql current timestamp table 
Sql :: oracle list datafiles 
Sql :: sql pagination 
Sql :: mysql update join 
Sql :: mysql store ip address 
Sql :: check postgresql version in rails console 
Sql :: oracle case 
Sql :: python pandas df to postgres json table 
Sql :: date sql get the last week count 
Sql :: oracle revoke grant 
Sql :: convert varchar column to int in sql server 
Sql :: excel export from sql using python 
Sql :: how to check grants on a package in oracle 
Sql :: how to extract only year and month from date in sql 
Sql :: mysql find duplicates in same table 
Sql :: null sql 
Sql :: mysql add column to table 
Sql :: SQL Multiple Cases 
Sql :: adding generated time in row mysql workbench 
Sql :: sql count unique values in one column 
Sql :: mysql timestamp format 
Sql :: postgres update multiple columns 
Sql :: mysql delete database 
Sql :: sql order by multiple columns 
Sql :: check database sessions oracle 
Sql :: oracle duration between timestamps 
Sql :: mysql min value row 
Sql :: mysql url data type 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =