esiason14 Posted January 29, 2007 Share Posted January 29, 2007 I have two tablesplayers [code] `player_id` smallint(5) unsigned NOT NULL auto_increment, `lname` varchar(50) default NULL, `fname` varchar(50) default NULL, `active` tinyint(1) unsigned default '1', PRIMARY KEY (`player_id`)[/code]AND rosterplayers[code] `player_id` smallint(5) unsigned NOT NULL default '0', `team_id` smallint(5) unsigned default '0', PRIMARY KEY (`player_id`)[/code]Each has a player_id field.What I want to do is retrieve a list of players that are NOT in the rosterplayers table. Make sense. I've tried several ways and it's just not working for me. Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/36242-solved-querey-help/ Share on other sites More sharing options...
shoz Posted January 29, 2007 Share Posted January 29, 2007 [code]SELECTp.*FROMplayertable AS pLEFT JOINrostertable AS rONp.player_id = r.player_idWHEREr.player_id IS NULL[/code] Link to comment https://forums.phpfreaks.com/topic/36242-solved-querey-help/#findComment-172311 Share on other sites More sharing options...
esiason14 Posted January 30, 2007 Author Share Posted January 30, 2007 Thank you, sir. :) Link to comment https://forums.phpfreaks.com/topic/36242-solved-querey-help/#findComment-172328 Share on other sites More sharing options...
esiason14 Posted January 30, 2007 Author Share Posted January 30, 2007 ...and I just wanted to add. I do know how to spell "query". It was a typo in the title :( Link to comment https://forums.phpfreaks.com/topic/36242-solved-querey-help/#findComment-172330 Share on other sites More sharing options...
artacus Posted January 30, 2007 Share Posted January 30, 2007 Oh, I thought it was French :) Link to comment https://forums.phpfreaks.com/topic/36242-solved-querey-help/#findComment-172513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.