T-SQL Query Results Not as Expected Deduplication

Posted by Yoda on Stack Overflow See other posts from Stack Overflow or by Yoda
Published on 2010-05-21T08:56:56Z Indexed on 2010/05/21 9:00 UTC
Read the original article Hit count: 401

Filed under:
|

Hi Guys,

I am attempting to get all records where and Id field exists more than once, trouble is my query is returning nothing and I have no idea as to why!? And this is the only method I know.

Here is my code:

        select 
[Customer Number], 
[Corporate Customer Number], 
[Order Date], 
[Order Number],
[Order No], 
[Order Line Status],
[Payment Method] , 
[ProcessOrder], 
[Order Platform] 

from Temp_ICOSOrder

    group by 
[Customer Number], 
[Corporate Customer Number], 
[Order Date], 
[Order Number],
[Order No], 
[Order Line Status],
[Payment Method] ,
[ProcessOrder] , 
[Order Platform]

    having COUNT([Order Number]) > 1

Any help is much appriciated!

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about deduplication