Hi,
I have a table with columns:status, gl_date and others.
Status can take one of three values: CONFIRMED, REMITTED, CLEARED.
My problem is that User wants to select record for a particular gl_date with preference.
The order of preference is:
1.CONFIRMED 2.REMITTED 3.CLEARED
If only REMITTED AND CLEARED records are present then only row with REMITTED should be selected. Likewise if all three records are present for a gl_date then only CONFIRMED record should be selected.
How can i achieve this with a single query? I tried DECODE but could not come up with anything concrete.
Any help will be greatly appreciated.
Thanks,
Prashant
I have a table with columns:status, gl_date and others.
Status can take one of three values: CONFIRMED, REMITTED, CLEARED.
My problem is that User wants to select record for a particular gl_date with preference.
The order of preference is:
1.CONFIRMED 2.REMITTED 3.CLEARED
If only REMITTED AND CLEARED records are present then only row with REMITTED should be selected. Likewise if all three records are present for a gl_date then only CONFIRMED record should be selected.
How can i achieve this with a single query? I tried DECODE but could not come up with anything concrete.
Any help will be greatly appreciated.
Thanks,
Prashant