I have three tables TableA, TableB and TableC. TableA has the following columns
MyId
IsFound
I want to update Table.IsFound to Yes or No based on the below result.
SELECT t1.MyId FROM TableA t1 WHERE t1.MyId IN (
SELECT t2.Id FROM
TableB t2, TableC t3
WHERE t2.Value1 = t3.Value1 AND t2.Value1 !='XXXX' AND t3.Value1 !='XXXX');
Expected logic:
If t1.MyId is not null
Update TableA.IsFound ="Yes"
Else
Update TableA.IsFound ="No"
End If
Thanks for your help. I couldn't find the solution because of my basic SQL knowledge.