MySQL Forums
Forum List  »  Italian

Aiuto per query
Posted by: panix panix
Date: April 21, 2023 03:55AM

Buongiorno,
grazie a chi saprà darmi una mano.

Ho una tabella di questo tipo:

__________________________________________
DATA | VALORI | TIPO
__________________________________________
2023-01-01 | val1 | Tipo1
__________________________________________
2023-01-01 | val2 | Tipo2
__________________________________________
2023-01-01 | val3 | Tipo3
__________________________________________
2023-01-02 | val4 | Tipo1
__________________________________________
2023-01-02 | val5 | Tipo2
__________________________________________
2023-01-02 | val6 | Tipo3
__________________________________________

e così di seguito


Vorrei realizzare una query che mi realizzi questa tabella:


DATA | VALORI
_____________________________________________________
2023-01-01 | (val1 * A) + (val2 * B) + (val3 * C)
_____________________________________________________
2023-01-02 | (val4 * A) + (val5 * B) + (val5 * C)

Dove A, B, C sono 3 costanti e andando a "pescare" i valori in base al tipo.

Potete aiutarmi?
Grazie

Options: ReplyQuote


Subject
Views
Written By
Posted
Aiuto per query
151
April 21, 2023 03:55AM


Sorry, only registered users may post in this forum.

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.