MySQL Forums
Forum List  »  InnoDB

Re: query by first occurrence in group
Posted by: ROB MARTINI
Date: May 22, 2019 01:49PM

My target is to extract record which have maximum value for "number" field for every sector, but where if It exists multiple records having the maximum value in every sector group Iìll have to choose one, don't worry what record is it.
I'll give another example, I run query which gives records with maximum value for every sector group:

sector, matric

orto 001
orto 002
orto 003
orto 004
neu 005
neu 006
neu 006

In "orto" sector there n.4 matric with same same maximum value.
In "neu" there are n.3 matric with same same maximum value.
...

I'd like to extract one (any) of n.4 "orto" records, one of n.3 "neu" records
Don't worry what the matric is in sector group, It's necessary for example the first one.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: query by first occurrence in group
684
May 22, 2019 01:49PM


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.