•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 401,534 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,383 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 461 | Replies: 2 | Solved
![]() |
•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,165
Reputation:
Rep Power: 7
Solved Threads: 58
Use the LIMIT keyword (Similar to TOP in MSSQL) If you use ORDER BY to order the results descending, so that the latest records will be at the top of the result set. Then use LIMIT to get just the first three of those records.
SELECT someColumn FROM someTable ORDER BY someColumn DESC LIMIT 3
Last edited by hollystyles : Jan 15th, 2008 at 3:46 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Pulling a portion of text from a MySQL table
- Next Thread: SQL Update Script



Linear Mode