dflow Posted June 19, 2011 Share Posted June 19, 2011 i have 2 tables: old new field is name: what this the correct way to compare new entries(not in old)? Link to comment https://forums.phpfreaks.com/topic/239796-compare-2-tables/ Share on other sites More sharing options...
AbraCadaver Posted June 19, 2011 Share Posted June 19, 2011 Not positive, but try: SELECT name FROM new WHERE name <> (SELECT name FROM old) Link to comment https://forums.phpfreaks.com/topic/239796-compare-2-tables/#findComment-1231778 Share on other sites More sharing options...
dflow Posted June 19, 2011 Author Share Posted June 19, 2011 Not positive, but try: SELECT name FROM new WHERE name <> (SELECT name FROM old) iget error Subquery returns more than 1 row Link to comment https://forums.phpfreaks.com/topic/239796-compare-2-tables/#findComment-1231780 Share on other sites More sharing options...
dflow Posted June 19, 2011 Author Share Posted June 19, 2011 ok the correct syntax is: SELECT name FROM new WHERE name NOT IN (SELECT name FROM old) thanks Link to comment https://forums.phpfreaks.com/topic/239796-compare-2-tables/#findComment-1231781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.