Can't understand lack of matching records using left join

10 views
Skip to first unread message

John Choiniere

unread,
Mar 1, 2014, 6:09:55 PM3/1/14
to baseball-sq...@googlegroups.com
Hi folks,

I feel really stupid asking this, but I CANNOT figure out why this is returning all null values.

Table z has fields player, fg_id, bpro_id, and a bunch of projected numbers. Table s has fields fg_id and a bunch of projected numbers. Table p had fields bpro_id and a bunch of projected number.  z.fg_id and z.bpro_id are varchar(255); s.fg_id is varchar(255); p.bpro_id is INT(11).

Running the query
select
   z.player,
   p.*
from z
left join p
on z.bpro_id = p.bpro_id

Returns exactly what I expect; running
select
   z.player,
   s.*
from z
left join s
on z.fg_id = s.fg_id

returns only NULL values.  I've checked in excel with vlookup that the fg_id values match between the two csv files used for import.  I can't figure out why everything's null.  Anyone have any thoughts? Am I missing something obvious?

Reply all
Reply to author
Forward
0 new messages