I need help isolating multiple entries in order.
| Column A | Column B | Column C |
|---|---|---|
| 100a | 1000 | ABC |
| 100a | 1000 | DEF |
| 200b | 2000 | GHI |
| 300c | 3000 | JKL |
| 300c | 3000 | MNO |
There are duplicates in Column A (which has a 1:1 relationship to column b). However, they have a 1:many with column C. Column C will always be unique.
I need to create a report that returns:
| Column A | Column B | Column C | Column D |
|---|---|---|---|
| 100 | 1000 | ABC | DEF |
| 200 | 2000 | GHI | |
| 300 | 3000 | JKL | MNO |
Any help? I am pretty new to SQL so this is giving me a lot of trouble figuring it out.
I am at a loss where to start. I tried to declare a variable, but not sure where to start with it.
If it's no more than 2 values in
Column CforColumn A+Column Bkey, then a query below would work. It will not work for 3 or more values(live demo: dbfiddle )