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

SQL ORDER BY ASC (Ascending Order)

SELECT *
FROM Customers
ORDER BY age ASC;
Comment

how to ascending order in sql

SELECT *
FROM employees
ORDER BY employees.employee_id DESC ;
Comment

SQL ORDER BY With WHERE

SELECT last_name, age
FROM Customers
WHERE NOT country = 'UK'
ORDER BY last_name DESC;
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

SQL ORDER BY Clause

SELECT *
FROM Customers
ORDER BY first_name;
Comment

order by in sql

ORDER BY: is for sorting result
either in descending or ascending order.
Comment

PREVIOUS NEXT
Code Example
Sql :: incompatible sql_mode=only_full_group_by 
Sql :: psql select database 
Sql :: IS NOT NULL statement 
Sql :: how to select distinct in mysql 
Sql :: date format mysql 
Sql :: create function syntax sql server 
Sql :: run postgresql dump to csv 
Sql :: python mysql query where 
Sql :: oracle login as sysdba 
Sql :: mysql version 
Sql :: test the postgresql db connection 
Sql :: sql row number in result set 
Sql :: mysql grant select update insert delete 
Sql :: dual in db2 
Sql :: join multiple tables sql 
Sql :: postgresql delete multiple rows 
Sql :: raiserror nowait sql server 
Sql :: sql cheatsheet 
Sql :: find usage of table in sql server 
Sql :: change password postgres pgserver 
Sql :: get max salary from each department sql 
Sql :: set all auto_increment values in sql 
Sql :: what is datetime in sql server 
Sql :: drush run sql select 
Sql :: mysql function 
Sql :: alter or change postgresql sequence counter 
Sql :: sql select date add day 
Sql :: oracle nvl2 
Sql :: multiple replace value mssql 
Sql :: mysql community server 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =