mysql - How to get maximum no of id exist in one table? -
i want find maximum number of id
s present in table. example, have user_views
table:
user_views ------------------- u_v_id package_id 1 24 2 24 3 24 4 25 5 25 6 26 7 27
and packages table:
package_id name
the maximum number of id
s present in 1 table 24 , on.
how can write query pull value?
select package_id, count(*) count mytable group package_id order count(*) desc limit 1
Comments
Post a Comment