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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting the nth row with a GROUP BY

Status
Not open for further replies.

mellenburg

Programmer
Joined
Aug 27, 2001
Messages
77
Location
US
I have a table that has 5 groups. From each group (of varying number of rows), I would like to select the 10th row. Can this be done in a query?

If not, or in addition, is there a way to add a column to a table that would be the row number of each group. For instance.

Group NEWCOLUMN
A 1
A 2
A 3
B 1
B 2
B 3
B 4
B 5

etc...
 
>> I have a table that has 5 groups. From each group (of varying number of rows), I would like to select the 10th row. Can this be done in a query? >>

Not with Mysql. You have to do that in your application.

The same holds for the second question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top