MySQL Forums
Forum List  »  InnoDB

query by first occurrence in group
Posted by: ROB MARTINI
Date: May 22, 2019 12:46PM

With a table with 2 fields as:

sector, number, matriculate

doct 2 A
doct 5 B
doct 5 C
info 0 D
info 1 E
info 4 F
info 4 G
tech 2 H
tech 3 I

I want extract for every sector, which has maximum "number", the first record:

doct 5 B
info 4 F
tech 3 I

what is query to make this job please ?

Options: ReplyQuote

Written By
query by first occurrence in group
May 22, 2019 12:46PM

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.