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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -