Reputation: 1613
I have the following subquery:
Acc Tel Prod1 Prod2
1000 | 281-xxx-4809 | No | Yes
1000 | 281-xxx-4809 | Yes | No
How do I select those two columns by the Acc
column into only one like this:
Acc Tel Prod1 Prod2
1000 | 281-xxx-4809 | Yes | Yes
Using SQL?
Upvotes: 0
Views: 31
Reputation: 12318
Shouldn't this work?
select Acc, Tel, max(Prod1), max(Prod2)
group by Acc, Tel
It's based on alphabetical order, but that works fine for you.
Upvotes: 4