php - Get most common value from DB -


i have table contains thousands of rows. columns include user_id , city

i wanting echo/print common city 'user_id' (user_id value on page)

can help?

thanks

please try this:

select city, count(city) countcity user_logins  group city order countcity desc limit 1 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -