MySQL Forums
Forum List  »  Newbie

First 'N' rows of each
Posted by: Malte
Date: October 19, 2006 12:23PM

For example: Table (type, serial#), with data
('X', 1000)
('X', 1001)
('X', 1003)
('X', 1010)
('Y', 1002)
('Y', 1005)
('Y', 1011)
('Z', 1015)

How would I retrieve at most 2 rows for each type?

('X', 1000)
('X', 1001)
('Y', 1002)
('Y', 1011)
('Z', 1015)

Options: ReplyQuote


Subject
Written By
Posted
First 'N' rows of each
October 19, 2006 12:23PM
October 19, 2006 02:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.