PHP | How to sort and count some values from the database?

It seems that everything is very simple, but stuck on this.
First you need to find in the table "ABC" with columns "A" "B" "C" records where "A "= 10, and these recordings add up the values from column "B"

Generally it is right to record if values of 10 in A can be any number?
July 9th 19 at 11:02
1 answer
July 9th 19 at 11:04
Solution
select A, sum(B) from ABC where A in (10, 20, 30) group by A;
According to the error, sum(points) - invalid expression - layla commented on July 9th 19 at 11:07
Suddenly... the type of the column B is what? - Daphne_Roob commented on July 9th 19 at 11:10
: int - layla commented on July 9th 19 at 11:13
I don't know... try SUM(B) or check whether wrote.
Kind of function should not have been abolished - www.w3resource.com/mysql/aggregate-functions-and-g... - Daphne_Roob commented on July 9th 19 at 11:16
: a little confused, the error in the subsequent function which should output the answer. What is the function responsible for the output response? - layla commented on July 9th 19 at 11:19
Try: select A, sum(B) as sumresult from ABC where A in (10, 20, 30) group by A;
Then the column will have a normal name "sumresult". - Daphne_Roob commented on July 9th 19 at 11:22

Find more questions by tags PHPMySQL