Board index » delphi » LEFT, RIGHT and INNER join

LEFT, RIGHT and INNER join

Hi!
I have noticed a great difference between these 3 joins. I know how they
fetch data, but they also make different plan to execute SQL. For example,
the same SQL will execute much differently with LEFT and INNER join (even
result set is the same). RIGHT join is a different story.

I would like to know more about those joins. How they actually work (make
plan, actually join tables and fetch data), when to use witch one and things
like that.

Or is the best method to try them all and to see which one gives best
results.

Thanks to all,

Mario Blataric

 

Re:LEFT, RIGHT and INNER join


Find a good SQL reference book or a good SQL reference on the Web if
you want to understand the difference. The short answer is that a left
join returns all rows from the left table whether there are matching
rows in the right table or not. A right join is the opposite. An inner
join only returns rows that exist in both tables.

On Fri, 6 Sep 2002 11:47:11 +0200, "Mario Blataric"

Quote
<mario.blata...@vz.hinet.hr> wrote:
>Hi!
>I have noticed a great difference between these 3 joins. I know how they
>fetch data, but they also make different plan to execute SQL. For example,
>the same SQL will execute much differently with LEFT and INNER join (even
>result set is the same). RIGHT join is a different story.

>I would like to know more about those joins. How they actually work (make
>plan, actually join tables and fetch data), when to use witch one and things
>like that.

>Or is the best method to try them all and to see which one gives best
>results.

>Thanks to all,

>Mario Blataric

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads