Join and Where: What's the difference? 
Author Message
 Join and Where: What's the difference?

Hi all,

This is definately gonna look like a lame question......but,

Can someone please explain the difference between the Inner Join and Where
commands in SQL?  I manage to get all my outputs from a database using
Where; though I've just read somewhere on here that using the Inner Join
method is the only way to get multiple fields from different tables into a
single output recordset.

Can someone kindly explain please?

Regards

Oz



Sun, 19 Aug 2001 03:00:00 GMT  
 Join and Where: What's the difference?
There may be some differences in the execution plan, but they can be used
interchangeably.
I find WHERE more to my liking, but it pays to know JOIN in order to use
OUTER joins.
Also, where more than two tables are in play, the JOIN syntax can get
tricky.

Also, I think the WHERE support in SQL Server is extended from the ANSI
standards which use JOIN.
All of the above is subject to change if someone knows better.
--
Gary (MCT, MCPS, MCSD)
http://www.enter.net/~garyl/  for references to good books

ICQ 6375624

Quote:

>Hi all,

>This is definately gonna look like a lame question......but,

>Can someone please explain the difference between the Inner Join and Where
>commands in SQL?  I manage to get all my outputs from a database using
>Where; though I've just read somewhere on here that using the Inner Join
>method is the only way to get multiple fields from different tables into a
>single output recordset.

>Can someone kindly explain please?

>Regards

>Oz



Sun, 19 Aug 2001 03:00:00 GMT  
 Join and Where: What's the difference?
You have two chioces when using SQL Server for joining tables.
Either ANSI standard where the join is performed in the FROM clause
as such
        FROM Table1 INNER JOIN Table2 ON Table1.F1 = Table2.F1
        FROM Table1 LEFT OUTER JOIN Table2 ON Table1.F1 = Table2.F1
OR
The other way is through the WHERE clause as you have been doing.

I'm pretty sure that the performance is exactly the same...maybe
someone else can confirm!???

Quote:

>Hi all,

>This is definately gonna look like a lame question......but,

>Can someone please explain the difference between the Inner Join and Where
>commands in SQL?  I manage to get all my outputs from a database using
>Where; though I've just read somewhere on here that using the Inner Join
>method is the only way to get multiple fields from different tables into a
>single output recordset.

>Can someone kindly explain please?

>Regards

>Oz

Many Thanks
Darren Lewis

Remove the _nospam to respond.


Sun, 19 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Displaying from 'joined' tables

2. Acc20: Working Querydef's SQL Property Yields Unsupported Join Expression

3. Getting names from db with id's from xml (dataset join question)

4. BuildMaster just join Visual Basic's camp

5. You're invited to join NaSPA (fwd)

6. how to join to access database's in vb6

7. Creating a join on tables in two different MSSQL 6.5 DB's

8. BuildMaster just join Visual Basic's camp

9. Joining 2 menu's into one pop-up

10. BuildMaster just join Visual Basic's camp

11. BuildMaster just join Visual Basic's camp

12. BuildMaster just join Visual Basic's camp

 

 
Powered by phpBB® Forum Software