WorldofASP.NET : ASP.NET Tutorial, Hosting, and Source Code
You are 1 of 219 users

Product SpotLight Hosting SpotLight

Eliminate Duplicates in a Group By Query

Blogger : DotNetSlackers Latest ASP.NET News in Category SQL
All posts : All posts by DotNetSlackers Latest ASP.NET News in Category SQL
Category : MSSQL
Blogged date : 2008 Apr 15

I had someone ask me this question today about a query where he wanted to get a max value along with the ID and Date of the record. However, the varying Date values were causing “duplicates” (as you would expect). He only wanted the first instance he came across. In SQL 2000 I would have written a subquery to do this most likely, but SQL 2005 has a nice RANK T-SQL function you can use instead: select * into #temp from (     select 1000 ID, -2 SomeValue, dateadd(mm,...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Read comments or post a reply to : Eliminate Duplicates in a Group By Query
Page 214 of 1589
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | FREE ASP.NET CMS | Phone Card | PHP Directory | Bangkok Hotels |Calling Card