Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Nov 14, 2018 10:04 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Real Sql db Right Join.
PostPosted: Sat Dec 22, 2012 10:05 am 
Offline

Joined: Sat Feb 04, 2012 1:26 pm
Posts: 86
Location: Italy
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Real Sql db Right Join.
PostPosted: Sat Dec 22, 2012 10:32 am 
Offline

Joined: Sun Nov 23, 2008 12:27 am
Posts: 404
can you provide a code snippet with select statement?


Top
 Profile  
Reply with quote  
 Post subject: Re: Real Sql db Right Join.
PostPosted: Sat Dec 22, 2012 11:08 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Real Sql db Right Join.
PostPosted: Sat Dec 22, 2012 11:55 am 
Offline

Joined: Sun Nov 23, 2008 12:27 am
Posts: 404
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Real Sql db Right Join.
PostPosted: Sat Dec 22, 2012 12:55 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
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.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Real Sql db Right Join.
PostPosted: Sat Dec 22, 2012 4:55 pm 
Offline

Joined: Sat Feb 04, 2012 1:26 pm
Posts: 86
Location: Italy
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Real Sql db Right Join.
PostPosted: Sun Dec 30, 2012 1:21 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
Yes that's a poorly done piece of documentation.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group