mysql - Count columns where -
my problem in db table, amx_admins_servers
columns admin_id
, server_id
, custom_flags
, use_static_bantime
, looks like
and need count columns (server_id) have value of 4, 7, 10, 12 , print
server_id 4 - x times server_id 7 - x times server_id 10 - x times server_id 12 - x times
the sample data shows 4 servers; if there other servers, though, should not shown.
any ideas?
select server_id, count(*) x_times amx_admins_servers server_id in (4, 7, 10, 12) group server_id
Comments
Post a Comment