Home Forums SQL Server 2008 T-SQL (SS2K8) Avoiding cursor: Help with getting only first match after previous match RE: Avoiding cursor: Help with getting only first match after previous match

  • thava (11/19/2012)


    dwain.c (11/15/2012)


    ... SNIP

    Where the code says AND b.aDate >= c.aDate, try making that AND b.aDate > c.aDate and run it both ways.

    ... SNIP

    just by curiosity the last row of the result is not matched so i think adding an identity to the #table2 and using that will solve this issue may i right or we will need to work more

    For each item ONE of the two runs gets the correct result - where the differences occur required manual inspection to choose the right one. - But it happened a lot less than you'd think for the real data - less than 200 manual checks out of around 80,000 matches.