Jump to content

LEFT JOIN value used in WHERE issue [Warning! Warning in title.]


onedumbcoder

Recommended Posts

i left join table2 and i want a value returned from that to be used in the where condition.

 

so both table1 and table2 have a field called sheep. I want to query to execute only if what is returned by the left join is equal to the value stored in table1 (table1.sheep = table2.sheep) or is nothing is return by the left join of table2

 

I have this and it is not working

 

UPDATE
table1 LEFT JOIN table2 ON (table2.type = 3) 
SET
table1.type=3
WHERE 
table1.sheep = table2.sheep OR table2.sheep = ''

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.