Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • RE: UNION problem

    select * from one where where_cond

    union

    select * from two where exists (select * from one where where_cond) [AND where_cond]

  • RE: SQL Statement Question - Ghuru needed!

    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...

  • RE: Problem with restricting self joins.

    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,...

Viewing 3 posts - 1 through 3 (of 3 total)