|
Note: I originally asked this yesterday on StackOverflow. However, the high-turnover of questions means there is little chance of getting a satisfactory answer. I have this
If you plug in the
How do you use the outer clause on an inner statement? Hell, I don't even know if I am using the correct terminology to describe my problem. Arrgghh - Set based logic does my head in!!
(comments are locked)
|
|
The simplest form is this:
However, you would probably be better doing that as a join set rather than a scalar sub-query. I'll leave you to figure that one out for yourself! Implemented as a LEFT JOIN it takes ~2m 40s. Your way (and the way I was trying originally) takes ~2m 10s.
Oct 20 '09 at 07:01 AM
graham.reeds
If you've got some sample data you could put up in a ZIP somewhere, I'd be happy to try and make it zip along a bit :)
Oct 20 '09 at 07:12 AM
Matt Whitfield ♦♦
..Afraid not;-)
Oct 20 '09 at 07:47 AM
graham.reeds
(comments are locked)
|
|
Where are you setting the value of @X? Are you trying to do a correlated subquery? Edit : following on from OPs comments.... That's what I want to know - how to get @X from the left hand side of the problem.
Oct 20 '09 at 06:08 AM
graham.reeds
(comments are locked)
|

