Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Most Recent X Records per Customer

Status
Not open for further replies.

briangriffin

Programmer
Nov 6, 2008
878
0
0
US
New to MySQL - I could probably get this working in SQL Server, but I wouldn't be confident that the syntax would translate.

Simple task: multiple records per customer:

RecordID Customer
1 Joe
2 Joe
3 Joe
4 Joe
5 Sue
6 Sue
7 Sue
8 Sue

Need only the most recent three records per customer:

RecordID Customer
2 Joe
3 Joe
4 Joe
6 Sue
7 Sue
8 Sue

What is the most efficient way to do this in MySQL? Thanks in advance.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top