Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Find New Customers

    select distinct

    c.cus_id

    from

    @customers c

    inner join

    @orders o

    on c.cus_id = o.cus_id

    where

    o.order_date between @start and @end

    andc.cus_id not in (select o2.cus_id from @orders o2 where o2.order_date < @start);

    --- Full Test ---

    declare @customers table...

Viewing post 1 (of 1 total)