MySQL Forums
Forum List  »  Newbie

Query help
Posted by: panix panix
Date: April 21, 2023 04:38AM

Good morning,
Thanks to all can help me.

I have this table:

__________________________________________
DATE | VALUE | TYPE
__________________________________________
2023-01-01 | val1 | Type1
__________________________________________
2023-01-01 | val2 | Type2
__________________________________________
2023-01-01 | val3 | Type3
__________________________________________
2023-01-02 | val4 | Type1
__________________________________________
2023-01-02 | val5 | Type2
__________________________________________
2023-01-02 | val6 | Type3
__________________________________________

It continues in the same way


I'd like to realize a query that show me this table:


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

Where A, B, C are 3 constants and selecting the values with the type column.

Can anyone help me?
Thanks

Options: ReplyQuote


Subject
Written By
Posted
Query help
April 21, 2023 04:38AM


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.