List:General Discussion« Previous MessageNext Message »
From:Olav Mørkrid Date:July 17 2007 8:09am
Subject:left join, right join failure with mysql4
View as plain text  
hi

i am experimenting with sql for getting lists of friends.

select friend.*
from user
       left join link on user.id=link.id and user.id = $MYID
       right join user friend on link.friend_id = friend.id
where user.name is null;

on my local windows machine running mysql 5 it works fine, however
when i try with to import the tables to a unix machine running mysql
4, the select fails.

- if i do "user.name is null", i get an empty set.

- if i do "user.name is not null", i get 10000 rows, where each of the
100 rows from the user table is repeated 100 times each.

(the error might not even be related to mysql 4/5, but i am at a loss here)

does anyone know how to resolve this?
Thread
left join, right join failure with mysql4Olav Mørkrid17 Jul
  • RE: left join, right join failure with mysql4Edward Kay17 Jul
  • Re: left join, right join failure with mysql4Olav Mørkrid17 Jul