MySQL Forums
Forum List  »  Microsoft SQL Server

Re: Right join in mysql and sqlserver
Posted by: dragone
Date: February 08, 2006 02:19AM

The query (in sql server) is

select distinct …..
from
((( C INNER JOIN D ON C.c1=D.d1) RIGHT JOIN B ON C.c2 =B.b1 ) RIGHT JOIN A ON B.b2=A.a1)
where …;


I have tree main table A,B,C
Every table has a key that corresponds to a key in another table(a foreign key)
For example A.a1=B.b2.

The problem is that if there isn't a value in C that corresponds to a value in B the result is null and the query doesn't work well.
I would like that the query returns the lines even if there is no corrispondence in B and C
Thanks
DD

Options: ReplyQuote


Subject
Written By
Posted
February 07, 2006 10:02AM
Re: Right join in mysql and sqlserver
February 08, 2006 02:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.