JOINS

JOINS

Post by Serdou » Sat, 25 Aug 2001 07:45:07



Hey guys,
Hate to do this you, but I have a simple question.

I need to display information from 5 tables.  I know how to join 3 tables
but I am not about joining more than that.  Example, if you use PUBS, I want
to display an author's name, title, publisher and publisher's information.

Please help.
Thanks.

 
 
 

JOINS

Post by Paul Thornet » Sat, 25 Aug 2001 08:05:35



Quote:> I need to display information from 5 tables.  I know how to join 3
tables
> but I am not about joining more than that.  Example, if you use
PUBS, I want
> to display an author's name, title, publisher and publisher's

information.

SELECT t1.Col, t2.Col, t3.Col, t4.Col, t5.Col
FROM t1
INNER JOIN t2 ON t1.key=t2.key
INNER JOIN t3 ON t2.key=t3.key
INNER JOIN t4 ON t3.key=t4.key
INNER JOIN t5 ON t4.key=t5.key

--
Paul Thornett

Help fight Alzheimer's, Cystic Fibrosis and Mad Cow Disease
http://www.stanford.edu/group/pandegroup/Cosm/

 
 
 

1. Right Join / Hash Joins / Nested Joins

When I execute a query, with a RIGHT JOIN - clause (Select * from Table1
right join Table2 on... ), it returns the correct fields:all from Table2
and the matching fields from Table1.
When I execute the same query for two other tables, it only returns the
matching fields.

By analyzing the query in the Query-Analyzer, I found out, that the
wrong results were generated with a HASH-JOIN, while the correct results
were generated with NESTED-LOOPS-JOINS.

As I deleted most of the rows of the (left) table, the results became
correct.

2. AccessVBA to VB6 and SQL Server migration

3. Syntactic difference JOIN ON JOIN ON and JOIN JOIN ON ON?

4. Math and financial calculations in Visual Fox Pro

5. Left join sql Request (double mixing left join)

6. Strange error creating index - not sure I understand what's gone wrong

7. Converting ANSI Joins to "readable" joins

8. Connectivity problem with SQL 2000 client and SQL 7.0 database

9. Problem with Outer join and Inner joins

10. Settle the debate please - to join or not to join

11. Help on converting old style JOIN to ANSI JOIN

12. Outer joins returns inner join result!

13. Inner Join, Out Join Operators precedence