[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

difficult join?


I have the following situation

Three  tables

1) players
2) teams
3) team_player

'players' holds player records and player_id is auto_increment primary key
'teams' holds team records and team_id is auto_increment primary key
'team_player' is a table which holds records for
"which player belongs to which team"

That is team_player has 3 columns
1) id (auto_increment primary key)
2) team_id
3) player_id


My problem is that I want to extract the record set from 'players' table
for those players which do not belong to any team

ie they will not have  player_id in 'team_player' table.

I don't know how to write the join in the query .. if it is possible.

Any help is greatly appreciated.
I am not subscribed to the list so please cc any replies.

Thanks
Jaskirat


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread92902@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.