column1 column2 1 4 2 4 3 4
column1 1 2 3 4
select distinct col1 from tab1 union all select distinct col2 from tab1 order by 1
select a.col1, b.col2 from table1 a, table2 b where a.col2 = 5 and b.col1=4;