Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you solve this join issue...
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00644420
Message ID:
00645781
Vues:
16
Bill,

Yes, that is basically what I did. I can't believe the speed difference. The new one runs in about 3 minutes where the old SP, the one that had a correlated sub for each field we canceled after 17 hours!

Thanks,
BOb


>Hi Bob,
>
>What about this:
>
>SELECT sum(m.rgcur), sum(t.tax_cur), sum(h.hours)
>FROM py_ehmast m
>	INNER JOIN (
>	   	SELECT ehmast_id, sum(tax_cur) AS tax_cur FROM py_ehtax GROUP BY ehmast_id
>	) t
>		ON m.ehmast_id = t.ehmast_id
>	INNER JOIN (
>	   (SELECT ehmast_id, sum(hours) AS hours FROM py_ehhour GROUP BY h.ehmast_id
>	) h
>		ON m.ehmast_id = h.ehmast_id
>GROUP BY ee_id
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform