Update Query using Condition (1 Viewer)

Drunkenneo

Registered User.
Local time
Today, 13:10
Joined
Jun 4, 2013
Messages
192
I have a table

Main

Name Inter Intra Flag
------------------
A BB CC
as DD FF

And Table

Code table:

code Flag
----------
BB 1
CC 0
DD 0
FF 0


All the Flag reference taken from table, I want an update query where it checks if either of Inter and intra from Main table have flag as 1 from code table, it should update the flag in main as 1 else 0.

Could this be possible?
 

namliam

The Mailman - AWF VIP
Local time
Today, 09:40
Joined
Aug 11, 2003
Messages
11,695
Something along these lines:
Select main.*, inter, codeinter.flag, intra, codeintra.flag
From Main
Join Code as codeInter on inter = codeinter.code
join Code as CodeIntra on intra = codeintra.code
 

Users who are viewing this thread

Top Bottom