Order by with Null value in MySQL

Define the order by with NULL value in MySQL

Arrange the order of Null value in MySQL as follows:

Show the NULL value in last position in Mysql

SELECT * from employees order by country is null, country asc;

Show NULL value in first position in MySQL

SELECT * FROM EMPLOYEES ORDER BY country is not null, country desc;
This entry was posted in MySQL on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply