sql - Updating third table where id didnot match from other 2 table -




i have 3 tables

table a

id  remark   1   null     2   null     4   null 

table b

id  remark   1   null     2   null     4   null     

table c

id       1    2    3    

i want update table b remark joining table , table c records in table not exist in table c.

so final output like

table b

id  remark   1   null     2   null     4   invalid entry    

i have tried far below query:

update tableb set remark='invalid' not exists ( select id tablea join tablec on  tablea.id=tablec.id) 

but think there problem. can me in this.

you forgot connect tableb exists

update tabb set remark='invalid' tableb tabb not exists  ( select 1  tablea  join tablec  on  tablea.id=tablec.id  tabb.id = tablea.id ) 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -