Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2013
    Posts
    5

    Unanswered: Number of occurrences in Top 10 results

    Trying to find the number of times that a userID appears in the TOP 10 results of another select statement.

    "SELECT * FROM scores WHERE userID = '5' AND score > MIN(SELECT * FROM scores WHERE position = 'RB' ORDER BY score LIMIT 0,10)"

    Any help would be appreciated. Working on some stats for a personal fantasy football record-keeping website.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    SELECT userID
         , Count(*)
    FROM   (
            <insert your existing query here>
           ) As a_subquery
    GROUP
        BY userID
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •