Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
sql select top 10 values from database

I have a table called articles, each article has a rating value. I want to select * from the ten articles with the highest rating.

something along these lines

    $query = "SELECT TOP 10 rating FROM articles ORDER BY rating DESC";

I am confused about the TOP 10 part, I would usualy have SELECT * FROM

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Use LIMIT to do this

    $query = "SELECT * FROM articles ORDER BY rating DESC LIMIT 10";

Documentation here

over 4 years ago · Santiago Trujillo Report

0

you can do so by folloing SQL Query

 SELECT * FROM article ORDER BY rating DECS LIMIT 10;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!