Filter out similar data SQL Server 2008 -


i using sql server 2008 , navicat. need filter search results in next way:

1. data -  id 2. 24   -   1 3. 24   -   3 4. 50   -   5 5. 50   -   8 

i need leave 1 data max id value (distinct inside query doesn't work because data i'm looking not unique), result should be:

1. data -  id 3. 24   -   3 5. 50      8 

all rest similar data values should filtered out. in advance!

select data,max(id) tablename group data 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -