I have a pretty simple question me thinks. I've been looking on the internet, but haven't been able to find anything. I am trying to add an IF statement basically to my Oracle sql.
UPDATE PS_Z_TREND_NOW_TBL a
SET STATUS = (
SELECT COUNT(SEC.IS_AW_AUTH_NAME)
FROM PS_IS_AW_SECURITY sec
WHERE sec.IS_AW_AUTH_NAME LIKE '%Manager%'
I want to update STATUS so that if COUNT(SEC.IS_AW_AUTH_NAME) is greater than 0 it will insert 'M'. How would I write this?
CASEstatementsPS_Z_TREND_NOW_TBLupdated for all records if theCOUNT(SEC.IS_AW_AUTH_NAME)is greater than 0? Could it be that you want this done only whena.is_aw_auth_name = sec.is_aw_auth_name. Could it be that you want to use a correlated subquery in your where clause or merge statement?