Home Forums SQL Server 2005 T-SQL (SS2K5) Receiving duplicate key insert error with DISTINCT clause RE: Receiving duplicate key insert error with DISTINCT clause

  • Do you see dupes when you run just the Select DISTINCT?

    select DISTINCT

    a.org_id,

    a.absr_id,

    a.abs_id,

    a.abs_date

    from absence a (nolock)

    where a.abs_date between @StartDate and @EndDate

    and a.abs_deleted = 0

    and a.abs_id not in (select abs_id from @CloseAbs)

    I can think of no reason DISTINCT shouldn't do as its told.

    bc

    [font="Arial Narrow"]bc[/font]