Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3696830
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:47:11+00:00 2026-05-19T04:47:11+00:00

I have made a website for a ‘walking challenge’, which has a table that

  • 0

I have made a website for a ‘walking challenge’, which has a table that logs miles walked.

The target is 2105 miles (Newcastle, UK to Istanbul).

On the home page i have a leaderboard which currently shows the 5 teams who have racked up the most miles.

I am using the following query to achive this:

SELECT 
    SUM(log.distance) AS l, 
    log.*, 
    team.*
FROM 
    team
RIGHT JOIN 
    log ON team.teamname = log.teamname                             
GROUP BY 
    log.teamname
ORDER BY 
    l DESC

However i want this leaderboard to show the 5 teams that finished first rather than who have walked the furthest. ie, the teams who reached 2105 miles first.

The current website can be viewed here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:47:11+00:00Added an answer on May 19, 2026 at 4:47 am

    Add a nullable completedDate field to the table and populate it whenever someone completes the race. Order by the completed date.

    There’d be no way to order by who finished first otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a website on which a user has to log in using
I have made a website that has 2 WordPress installs one for English language
i have made a company website which has the MYSQL database of accounting,inventory,expenses, etc.
I have a website that I made and I am planning to redo it.
I have a website made with CakePHP 1.3.7. This website has it's own login
I have made a C# application that talks to my website via PHP(mcrypt) and
I have made a sample page, which has a logo page. It asks the
I have a website made in Asp.net MVC which is installed in the root
I have made a navbar at the top of my website which contains multiple
I have a personal website, which I have made (to the best of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.