Reputation: 861
I have a table txn(id,orig_num,rec_num)
How to write a query to return distinct values present in both column? I want to join these two columns (orig_num and rec_num) and return 1 column (say acct_num) which will have distinct account numbers. I am using sql server
Upvotes: 1
Views: 4008
Reputation: 204746
select orig_num as acct_num from your_table
union
select rec_num from your_table
Upvotes: 4