Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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;
Comment

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
Comment

DESC in sql

SELECT staffNo, fName, lName, salary
FROM Staff
ORDER BY salary DESC;
Comment

SQL ORDER BY DESC (Descending Order)

SELECT *
FROM Customers
ORDER BY age DESC;
Comment

sql order

SQL order of execution defines the
execution order of clauses.

-Select
It starts execution with 
-from  (Choose and join tables to get base data)
after from
-where ( filters base data )
-group by (Aggregates base data)
-having (filters aggregated data)
-select (returns final data)
-order by (sorts the final data)
-limit (limits the returned data to a row count)

Only select and from are mandatory
Comment

sql order by

Used to sort the result data in ascending (default) or descending order
through the use of ASC or DESC keywords.
Example: Returns countries in alphabetical order.
SELECT * FROM countries
ORDER BY name;
Comment

sorting desc in sql

order by statement in sql
Comment

desc sql

desc ENY
Comment

PREVIOUS NEXT
Code Example
Sql :: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client 
Sql :: sql output parameters 
Sql :: sql datetime functions 
Sql :: sql create table as 
Sql :: what is mysql 
Sql :: doctors appointment 
Sql :: like in sql 
Sql :: what is auto increment in sql 
Sql :: datatables server side filter where clause 
Sql :: timestamp type in sql 
Sql :: sqlite output query to csv 
Sql :: SQL Greater Than Operator 
Sql :: mysql procedure 
Sql :: sql year 
Sql :: oracle exchange subpartition 
Sql :: iterative instruction sql 
Sql :: sql examples from framework 
Sql :: mysql create link between tablesdatabase 
Sql :: sql truncate table referencing itself 
Sql :: db connection using sql client in dot net 
Sql :: formatting code with SQL Developer 
Sql :: oracle call a function in a insert statement 
Sql :: narural join 
Sql :: convert sql to linq online converter 
Sql :: mysql and 
Sql :: APEX elapsed time 
Sql :: python simple crud application using sqlite 
Sql :: merge query using linked server 
Sql :: sql count return 0 if no rows 
Sql :: check_username 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =