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!!
asked Oct 20, 2009 at 05:17 AM in Default
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!
answered Oct 20, 2009 at 06:01 AM
Matt Whitfield ♦♦
Where are you setting the value of @X?
Are you trying to do a correlated subquery?
Edit : following on from OPs comments....