Page 1 of 1

left join return null on some columns

Posted: Sat Nov 18, 2006 1:34 pm
by mbaroz
HI There
i have 2 tables:
1 . places : columns(PlaceID,PlaceName)- PlaceID is Prim and AutoInc.
2. PeoplePlaces:columns(PlaceID,MemberNo)

my query is:

Code: Select all

select places.* from places RIGHT JOIN peopleplaces ON places.PlaceID=peopleplaces.PlaceID WHERE peopleplaces.MemberNo='26'
The peopleplaces have 2 records for 2 places for same MemberNo=26

The above query return me only the PlaceID , the PlaceName is NULL or empty
why is that ?


Thanks for help
moshe.b

Posted: Sat Nov 18, 2006 3:32 pm
by califdon
I just created 2 tables from your description and that query returns both records. You may not have designed your tables like you said, or maybe there's a typo in your SQL statement.

If you have access to a MySQL command line, do: DESCRIBE Places; and DESCRIBE PeoplePlaces; to confirm your database structures.