Using a Select as a Var??

Giganews Newsgroups
Subject: Using a Select as a Var??
Posted by:  valigula (valigu…@gmail.com)
Date: Thu, 05 Jul 2007

Hi All
Need top repeat a select 3 times but with differents where condition.
I tried to repeat the selects and after use a couple of union to join
then, but it takes toooo long.

I also remember there was a way such as:

using var (select stamment)
select *
from var
where .....

but i can not remember the exact syntaxes.

Does anybody know?.

Thanks.

Replies