PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > Multiple joins in SQL Server
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Multiple joins in SQL Server

Réponse
 
LinkBack Outils de la discussion
Vieux 04/01/2008, 07h12   #1
narendra vuradi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Multiple joins in SQL Server

Hi I have a requirement where in i haev to convert the SQL from Oracle
to the one which will run on the SQL server.

in the Oracle Query i am doing multiple joins, between some 13 tables.
and some of these joins are inner joins and some are Left outer joins.

table1 inner joined with table 2
table2 inner join with table3
table2 inner join with table4
table2 left join with table5
table5 left jin with table6
table6 left jin with table7
table7 left jin with table8
table8 left jin with table9

Any idea how to achieve this??

Tia
naren
  Réponse avec citation
Vieux 04/01/2008, 07h31   #2
Ed Murphy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Multiple joins in SQL Server

narendra vuradi wrote:

> Hi I have a requirement where in i haev to convert the SQL from Oracle
> to the one which will run on the SQL server.
>
> in the Oracle Query i am doing multiple joins, between some 13 tables.
> and some of these joins are inner joins and some are Left outer joins.
>
> table1 inner joined with table 2
> table2 inner join with table3
> table2 inner join with table4
> table2 left join with table5
> table5 left jin with table6
> table6 left jin with table7
> table7 left jin with table8
> table8 left jin with table9


Easy peasy, e.g.

select <list of fields>
from table1
join table2 on table1.a = table2.a
join table3 on table2.b = table3.b
join table4 on table2.c = table4.c
left join table5 on table2.d = table5.d
left join table6 on table5.e = table6.e
left join table7 on table6.f = table7.f
left join table8 on table7.g = table8.g
left join table9 on table8.h = table9.h
  Réponse avec citation
Vieux 04/01/2008, 13h14   #3
Serge Rielau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Multiple joins in SQL Server

Narendra,

Assuming on Oracle you don't face the deprecated (+) syntax it should be
identical since the JOIN syntax is SQL Standard. What fails?

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09247 seconds with 11 queries