Skip to content
Advertisement

Oracle SQL: Case statement

I am not sure where to put the case statement whether in select or where clause. I am trying to get data from table c when cnt_subj = MEPC_PL then metric_id will be equal to 6135 from table m. Can anyone help? Thank you in advance! ๐Ÿ™‚

Advertisement

Answer

I think this is the query you are looking for:

Do you actually need the DISTINCT? Is there more than one row with those IDs? Also, you can expand this if you have other CNT_SUBJ values which you need to translate.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement