Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

query by first occurrence in group (5 replies)

$
0
0
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 ?

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>