[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.5

Help with ranking results of a query

Asked by MiamiDolphins in SQL Server 2008

Hi all. I hope this makes sense... :-)

I have a table with a list of drivers (who take part in karting events).

i also have a table called events (whichin this table we store the driverid, eventype,finishingposition and other details which for now is not important)

What i want to do is firstly

find out the top 10 drivers based on

total number of events they have taken part in
total number of event wins (where finishingposition = 1)


I've been playing around with possible ways to do this - but i think my way is rubbish to be honest (im not the greatest exponent of sql in all honesty)

the way i've tried doing it is as follows

i created a view called qrytotalraces and rank

SELECT     TOP (100) PERCENT Driver, DriverID,
                          (SELECT     COUNT(*) AS Expr1
                            FROM          dbo.qryEventDetails AS t2
                            WHERE      (t1.DriverID = DriverID) AND (EventTypeID = 7)) AS TotalRaces,ROW_NUMBER() OVER (ORDER BY (SELECT     COUNT(*) AS Expr1
                            FROM          dbo.qryEventDetails AS t2
                            WHERE      (t1.DriverID = DriverID) AND (EventTypeID = 7)) DESC) AS Ranking
FROM         dbo.TblDriver AS t1
ORDER BY TotalRaces DESC

Then on my online app i can find a driver by driverid and see their ranking.

the problem is

1. i think there must be a better more effective way to do ranking of results
2. i will need to actually do a few  more queries like this to get ranks based on other criteria
i.e - total wins, wins/races percentage, total podiums, total poles.

so i would in fact need 4 more queries like the above

is it possible to combine all this into 1 effective query
or if i had to use 5 queries in total to get the results i wanted (and display them in a grid)

what type of overhead would that be

bearing in mind i have over 4,000 drivers across a daily average of 20 events taking place.



Thanks guys/gals



by the way im using sql 2008
i did notice when i created my query i got the error
"SQL text cannot be represented in the grid pane and diagram pane."

i assume this is okay - given that the results are still displayed okay? (dont really need to see anything graphically)

[+][-]04/29/09 10:11 AM, ID: 24262548Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: SQL Server 2008
Sign Up Now!
Solution Provided By: Sharath_123
Participating Experts: 2
Solution Grade: A
 
[+][-]04/28/09 09:52 AM, ID: 24252641Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/28/09 10:29 AM, ID: 24252970Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/09 10:53 AM, ID: 24253261Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/28/09 11:45 AM, ID: 24253815Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/09 12:04 PM, ID: 24254053Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/28/09 03:35 PM, ID: 24255843Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/09 03:50 PM, ID: 24255940Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/09 03:51 PM, ID: 24255947Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/09 03:55 PM, ID: 24255981Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/28/09 04:04 PM, ID: 24256040Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/28/09 04:21 PM, ID: 24256120Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/28/09 07:58 PM, ID: 24257033Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/29/09 02:26 AM, ID: 24258526Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/29/09 02:32 AM, ID: 24258558Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/29/09 10:04 AM, ID: 24262474Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/29/09 10:09 AM, ID: 24262521Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/01/09 01:14 AM, ID: 24277339Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/01/09 01:41 AM, ID: 24277434Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625