Good morning everyone, I have the following case:
This is my Original Table:
Considering that the Max value in the above table is given by the order of the 9 frequencies (W1 < W2 < W3, etc.) i would like to build a query who will return the following:
So the query should go trough the same key (TASK_LIST_GRP & TASK_LIST_COUNTER) and check which is the max frequency (based on the order). If not any frequency is available, should mention "NO PKG".
Hope it is clear, appreciate you usual and kindly support.
Cheers,
L.
This is my Original Table:
TASK_LIST_GRP | TASK_LIST_COUNTER | W1 | W2 | W3 | W8 | M1 | M2 | M3 | M4 | Y1 |
OMBIRD | 01 | X | ||||||||
OMBIRD | 01 | |||||||||
OMBIRD | 02 | X | ||||||||
OMBIRSQ0 | 01 | X | ||||||||
OMBPCRQ1 | 01 | X | X | |||||||
OMBPCRQ1 | 01 | X | ||||||||
OMBPCRQ1 | 01 | X | ||||||||
OMBPCRQ1 | 01 | |||||||||
OMBPCRQ1 | 01 | |||||||||
OMBPCRQ1 | 02 | X | ||||||||
OMBTAC | 01 |
TASK_LIST_GRP | TASK_LIST_COUNTER | MAX FRQ |
OMBIRD | 01 | Y1 |
OMBIRSQ0 | 01 | Y1 |
OMBPCRQ1 | 01 | M3 |
OMBPCRQ1 | 02 | M1 |
OMBTAC | 01 | NO PKG |
Hope it is clear, appreciate you usual and kindly support.
Cheers,
L.