Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you solve this join issue...
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00644420
Message ID:
00645781
Views:
15
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
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform