MySQL Forums
Forum List  »  Italian

Raggruppamento improprio (max e min)
Posted by: guest guest3012
Date: January 05, 2017 07:55AM

Buongiorno, chiedo un'idea:
ho una tabella:
id_row | descrizione | tipo | dal | al |
-----------------------------------------------------
1 stato AN 2017-01-01 2017-01-31
2 genio AN 2017-01-01 2017-01-31
10 guardia AC 2016-12-01 2016-12-31
18 forza AS 2016-12-01 2016-12-31
19 militare AS 2016-12-26 2017-01-31

raggruppando per Tipo, ottengo:
tipo | dal | al |
-------------------------------
AC 2016-12-01 2016-12-31
AN 2017-01-01 2017-01-31
AS 2016-12-01 2016-12-31

ma quale artifizio potrei inventarmi x ottenere questo risultato ?
tipo | dal | al |
-------------------------------
AC 2016-12-01 2016-12-31
AN 2017-01-01 2017-01-31
AS 2016-12-01 2017-01-31 <-- in pratica,
raggruppando vorrei il MIN di "dal" e il MAX di "al" .

Grazie

Options: ReplyQuote


Subject
Views
Written By
Posted
Raggruppamento improprio (max e min)
1063
January 05, 2017 07:55AM


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.