Check if a field exists in another table

here4real

Registered User.
Local time
Today, 11:59
Joined
May 1, 2013
Messages
87
I have a query where I want to check if a value of one field exists in another table. If it does, I want to set a value to True and if not set it to False.

What is the easiest way to do this?

Thanks.
 
You could use a left join for this purpose.
Code:
select A.onefield, B.otherfield from table1 A left join othertable B on A.onefield = B.otherfield
Where B.otherfield equals NULL, B doesn't have this value.
Using the build in Nz function you can convert the NULLs to booleans.

Please provide the actual SQL statement for a to the point response.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom