mySQL question
- Started
- Last post
- 4 Responses
- morphinelips
ok, say I have playerIDs in one table, and I want to list all the playerIDs from the master player list that aren't present in the first table. I tried something like:
SELECT DISTINCT playermaster.playerID FROM playermaster, roster WHERE playermaster.playerID != roster.playerID AND roster.leagueID = '$leaguenum'
but it returns something pretty close to garbage....
anyone have any ideas?
- enobrev0
it should be something similar to
select t2.playerID FROM t2.players LEFT JOIN t1.players ON t2.player_id = t1.player_id WHERE t1.player_id = ''
something like that.. (off top) if some variation of that doesn't work, let me know and il check my notes...
- morphinelips0
Thx for the reply enobrev, I changed my code around to fit my tables and came up with:
select playermaster.playerID FROM roster LEFT JOIN playermaster ON playermaster.playerID = roster.playerID WHERE playermaster.playerID = '' AND leagueID = 13
I have tried it and some variations and i seem to always come up with a null result.
- morphinelips0
ah, i figured it out...thanks man :)
- enobrev0
what did you end up with?