Split data of columns in (if of is not null data of is null) [closed]

Using a UNION ALL appears to be working:

select list, dept_no
from
(
  select id, list, null as dept_no
  from emp
  union all
  select id, null , dept_no
  from dept
) 
order by id, list

See SQL Fiddle with Demo

Browse More Popular Posts

Leave a Comment