>>I'm having a Monday morning brain fart. In my query, I am performing a union against several tables to return one result set. I'd like to perform a where clause against that entire result set, but I'm not figuring out how to do it.
>>
>>Something like:
>>
>>
>>SELECT * FROM
>>(
>>
>>)
>>WHERE MyField = @MyFilter
>>
>
>Try using derived table (or CTE), e.g.
>
>;with cte as (Here goes UNIONoned query)
>
>select * from cte where ...
Hi Naomi,
Your response took 2 minutes. I'd appreciate it if you could cut that down to 1 minute in the future. I am a busy person. (JUST KIDDING, thanks for the prompt response!)