Have this table:
F1 T
A. 6
A. 3
A. 5
B. 4
I Need a SQL.
Ho to group by F1 and sun the related value in T?
To the end:
A. 14
B. 4
Query sum and group by
-
- Administrator
- Posts: 78647
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Query sum and group by
SELECT F1, Sum(T) AS SummaDiT FROM NomeDaTavola GROUP BY F1
Last edited by HansV on 25 Mar 2024, 08:10, edited 1 time in total.
Reason: to correct typo
Reason: to correct typo
Best wishes,
Hans
Hans
-
- NewLounger
- Posts: 17
- Joined: 16 Aug 2022, 05:39
Re: Query sum and group by
SELECT F1, Sum(T) AS SummaDiT FROM NomeDaTavola GROUP BY F1
-
- Administrator
- Posts: 78647
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Query sum and group by
Thanks for the correction! I will change my previous reply.
Best wishes,
Hans
Hans