.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Help with sql TOP (1)

Posted By:      Posted Date: September 11, 2010    Points: 0   Category :ASP.Net
Hello,SQL help.  The following code will return "1" record.  The returned record is the top point leader for "1 venue" within a poker tournament season...I have several venues, and would like to display "all the venue leaders" (Multitple Records).  I currently loop through my venues and create a list with this statement (1 record at a time).I think the problem is within the "SELECT TOP (1)".  I always get one result.  Not sure where to go from here. SELECT TOP (1) SUM(results1.trnpoints) AS ven_lead, results1.idnumber, results1.other4, lttable.samelocid, lttable.name AS locname, players.firstname AS playerfirst, players.lastname AS playerlast FROM players INNER JOIN results1 ON players.idnumber = results1.idnumber INNER JOIN lttable ON results1.ltid = lttable.ltid GROUP BY results1.other4, lttable.samelocid, results1.idnumber, lttable.name, players.firstname, players.lastname HAVING (results1.season = @season) AND (lttable.location = @location) ORDER BY lttable.samelocid, ven_lead DESC"Any help would be greatly appreciated.Thanks,ChuckE.

View Complete Post

More Related Resource Links

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend