Hi guys,

How can i convert code below into INNER JOIN style. Thanks

UPDATE def_1 SET Valid = 'Yes' WHERE id IN (SELECT id FROM def_2) 
AND paid IN (SELECT paid FROM def_2) AND valid IS NULL

Recommended Answers

All 2 Replies

UPDATE def_1 SET Valid = 'Yes' WHERE id IN (SELECT id FROM def_2) 
AND paid IN (SELECT paid FROM def_2) AND valid IS NULL

I assume your are talking about the sub-queries. Inner join def_2 to what table, on what condition, in which sub-query? If you can answer that question, then post your table specs.

Try this...

update def_1,def_2 set def_1.Valid = 'Yes'
where def_1.id=def_2.id and def_1.paid=def_2.paid
and def_1.valid is null
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.