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
Post a Comment