Viewing 3 posts - 1 through 3 (of 3 total)
select * from one where where_cond
union
select * from two where exists (select * from one where where_cond) [AND where_cond]
December 16, 2003 at 4:42 am
declare @Now char(8),
@AYearAgo char(8)
set @Now=convert(char(8),getdate(),112)
set @AYearAgo = convert(char(8),dateadd(year,-1,@Now),112)
select Field1, Field19 from MyTable where CreateDate between @AYearAgo and @Now
--or just use the one...
December 16, 2003 at 3:19 am
declare @t table ([Year] int, [ID] int, SubID int , Value int)
insert @t
select 1990, 1, 1, 12 union all
select 1991, 1, 1, 15 union all
select 1992,...
July 23, 2003 at 5:47 am
Viewing 3 posts - 1 through 3 (of 3 total)