digitalgod Posted July 10, 2006 Share Posted July 10, 2006 I'm trying to display everything in 1 table that's not in another table.[code]<?php$sql='SELECT * FROM djs WHERE name NOT?>[/code]I need to select all the djs from the djs table that are not in the djsweek table... how can I do that? Link to comment https://forums.phpfreaks.com/topic/14246-simple-query-help-solved/ Share on other sites More sharing options...
mrome Posted July 11, 2006 Share Posted July 11, 2006 Would have been a bit more help if you gave us the the columns of both tables. This will get u started.SELECT * FROM djs WHERE NOT EXISTS( SELECT * FROM djsweek WHERE djsweek.name = djs.name) Link to comment https://forums.phpfreaks.com/topic/14246-simple-query-help-solved/#findComment-55932 Share on other sites More sharing options...
digitalgod Posted July 11, 2006 Author Share Posted July 11, 2006 I tried that but it gave me an error....the columns of both tables match but I just need to check the names Link to comment https://forums.phpfreaks.com/topic/14246-simple-query-help-solved/#findComment-55934 Share on other sites More sharing options...
digitalgod Posted July 11, 2006 Author Share Posted July 11, 2006 nevermind my bad, had a 'name' too many in therethanks! Link to comment https://forums.phpfreaks.com/topic/14246-simple-query-help-solved/#findComment-55939 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.