Skip to content

Instantly share code, notes, and snippets.

@vincentdeelen
Created April 16, 2014 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentdeelen/10846223 to your computer and use it in GitHub Desktop.
Save vincentdeelen/10846223 to your computer and use it in GitHub Desktop.
Order the two tables using nulls first
select empno
, ename
, job
, deptno
from(
select null as empno
, null as ename
, null as job
, null as deptno
from emp
union
select empno
, ename
, job
, deptno
from emp
where deptno = 10
)
order by empno nulls first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment