php - Get records with max time inserted MySQL results -


i have data row in table.

i want select age occurs most.

person | group | age --- bob  | 1     | 32   jill | 1     | 32   shawn| 1     | 42   jake | 2     | 29   paul | 2     | 36   laura| 2     | 39 

desired set:

the age appears 32.

use following query

select person, count(*) c tablename group age 

you can add limit 1 only record , order maximum or minimum age. use following query

select person, count(*) c,age profile group age order c desc limit 0,1 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -