php - MySQL closest values order by count -



php - MySQL closest values order by count -

i have table:

name count name 1 1 name 2 1 name 3 1 name 4 1 name 5 2 name 6 2

if select name 2 (count = 1), how select next , previous item (name 3, name 1)? after values same.

how solve problem?

if want single query think might query loooking for.

select * table coun=(select coun table name='name1') , name!='name1'

i rename count column coun count agg. function in mysql. hope works you..

php mysql

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -