In Oracle, I have a table called "MyTable". This table has columns 'A' and 'B'. I want to find every unique combination of 'A' and 'B'. How would I do this? I'd prefer to do this in SQL rather than PL/SQL.
Example:
Dog Cat
Cat Dog
Horse Cat
Dog Cat
A unique combination above should return 3 rows.
Thank You
select distinct columnA, columnB from table
or
select columnA, columnB from table
group by columnA, columnB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With