Witajcie mam tabelę w oracle gdzie mam takie kolumny:
| PK | REC_ID | COL_A | COLB | COL_C |
|---|---|---|---|---|
| 1 | abc | null | 9 | 1 |
| 2 | def | hij | null | 2 |
| 3 | ggg | null | null | 1 |
| 4 | abc | null | null | 2 |
| 5 | opr | null | null | 1 |
i teraz potrzebuję tak zrobić ordera aby dane wróciły mi tak
| PK | REC_ID | COL_A | COLB | COL_C |
|---|---|---|---|---|
| 1 | abc | null | 9 | 1 |
| 4 | abc | null | null | 2 |
| 3 | ggg | null | null | 1 |
| 5 | opr | null | null | 1 |
| 2 | def | hij | null | 2 |
Chodzi o to, że najpierw pobieram te same REC_ID potem sprawdzam czy COL_A jest null jak jest to sprawdzam COL_B nie jest null to następne mają być rekordy z tym samym COL_B potem sprawdzam COL_C jak nie są null to pobieram wszystkie rekordy z tym smaym COL_C itd
Pomożecie bo ja wymiękłem (ach ten biznes)