nurbek
asked on
Join two tables and select distinct
Hi All,
I have to tables
users table -- user_email(field)
aaa@aa.com
bbb@cc.com
ccc@cc.com
test@test.com
mail_list table -- email(field)
aaa@aa.com
ddd@fff.com
sss@qq.com
test@test.com
output should be like this (distinct_email) ordered
aaa@aa.com
bbb@cc.com
ccc@cc.com
ddd@fff.com
sss@qq.com
test@test.com
I want to join two tables, and select disctinc email adres
thanks in advance
Nurbek
I have to tables
users table -- user_email(field)
aaa@aa.com
bbb@cc.com
ccc@cc.com
test@test.com
mail_list table -- email(field)
aaa@aa.com
ddd@fff.com
sss@qq.com
test@test.com
output should be like this (distinct_email) ordered
aaa@aa.com
bbb@cc.com
ccc@cc.com
ddd@fff.com
sss@qq.com
test@test.com
I want to join two tables, and select disctinc email adres
thanks in advance
Nurbek
ASKER
thanks for your quick reply
It works,
could you please explain order by 1?
It works,
could you please explain order by 1?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks!
UNION
select email from mail_list
order by 1