Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One of four possible children
Message
 
À
04/10/2007 17:11:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01258745
Message ID:
01258757
Vues:
13
Create Procedure NoNeedForAnSP @myValue int
 as
select TableP.*, tableX.FK, tableX.sales
 from tableP inner join
 (select * from tableA
  union
  select * from tableB
  union
  select * from tableC
  union
  select * from tableD) tableX
on tableP.PK = tableX.FK
where tableP.PK = @myValue
Brilliant Cetin!! Thank you very much.
Now a followup question (before I give you stars). Your solution works, but at what cost? Does this solution select all the records from TableA, TableB, TableC and TableD and place them into a temporary table TableX?

Thanks,
Einar
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform