php - how to select data that have the same value with sql? -
i have table 3 columns, id, name, , value, shown below. want count average id , value columns same, how can this?
+----+--------+-------+ | id | name | value | +----+--------+-------+ | 2 | rahmat | 3 | | 2 | olive | 5 | | 3 | sari | 3 | | 3 | ryan | 2 | | 1 | zaki | 1 | +----+--------+-------+
try using query:
select avg(value) table id = value the output sample table gave in op 1.5, since sari , zaki 2 users records have id , value columns equal.
Comments
Post a Comment