There are two fields in database table A, one is the category, and the other is the price
How to calculate the highest value, lowest value, and average price of No. 11 in the category in PHP
One category corresponds to N pieces of price data such as
11, 100
2, 120
11, 101
11, 101
11, 55
11, 99
5, 88
2, 103
11, 170
5, 98
select MAX(price),MIN(price),AVG(price) where category=11
I think it will be easier to find the answer if you remove php when searching and simply think of it as a sql question