Real Software Forums
http://forums.realsoftware.com/

Real Sql db Right Join.
http://forums.realsoftware.com/viewtopic.php?f=3&t=46314
Page 1 of 1

Author:  Antonio [ Sat Dec 22, 2012 10:05 am ]
Post subject:  Real Sql db Right Join.

Hi
I converted a Ms Access to a Real Sql Database. At the running, a message warned me a warning the sql code implemented in it contains right joins.
Is there an alternative to bypass that.
thanks for any suggestion.

Author:  Sky Stream [ Sat Dec 22, 2012 10:32 am ]
Post subject:  Re: Real Sql db Right Join.

can you provide a code snippet with select statement?

Author:  kermit [ Sat Dec 22, 2012 11:08 am ]
Post subject:  Re: Real Sql db Right Join.

Quote:
I converted a Ms Access to a Real Sql Database. At the running, a message warned me a warning the sql code implemented in it contains right joins.
Is there an alternative to bypass that.


Not sure whats 'wrong' with a right join, but a right join is just a left join with the table names the other way round.

For instance, a list of people and their cars showing only people who have a car, would be

Select name, registration from people, carlist
where people.personid = car list.personid;


Not all people have cars.
So to get a list of all people, even if they dont have a car, you use a left join:

Select name, registration from people
left outer join carlist on people.personid = carlist.personid;



But that is exactly the same as a right join done this way:

Select name, registration from carlist
right outer join people
on people.personid = carlist.personid;


The left/right bit tells you which is the 'more important' table: the one you get ALL rows from, even if there is nothing in the other table.

Author:  Sky Stream [ Sat Dec 22, 2012 11:55 am ]
Post subject:  Re: Real Sql db Right Join.

I am not sure if RS added the functionality, but I believe right and full outer joins are not supported in sqlite

http://www.sqlite.org/omitted.html

Author:  DaveS [ Sat Dec 22, 2012 12:55 pm ]
Post subject:  Re: Real Sql db Right Join.

Just do what Kermit suggested...

Swap the table names and use LEFT JOIN


I've been programming ORACLE and SQL for years.. and truth be told... I've never used a RIGHT JOIN...... LEFT JOINS make so much more sense from a "what the heck is this doing" point of view.

Author:  Antonio [ Sat Dec 22, 2012 4:55 pm ]
Post subject:  Re: Real Sql db Right Join.

Hi to all,
just come back home. Tryed your suggestion. It workssss. feel happy.

I did not realize right joins to be the something swapped left joins. thansk for helps.
Anyway, i have to admit :oops: , that for more complicate queries, I got some help from the ms access builder. :oops:


On My RS ver 2012 R1, the db.error message warned: "database error 1, right and full outer joins are non currenty supported."
Anyway took a look at the Real Sql database reference
http://docs.realsoftware.com/index.php/ ... _Reference
and it, seems to me (but i don't know if it is because of my not so good english) it says :

"The permissible expressions for the join operator are:
, | [NATURAL] [LEFT | RIGHT] | FULL] [OUTER | INNER | CROSS] JOIN"

maybe is that referred in sql code in general?

Author:  Jym [ Sun Dec 30, 2012 1:21 pm ]
Post subject:  Re: Real Sql db Right Join.

Yes that's a poorly done piece of documentation.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/