"""select * from table where json_contains(param-> '$[*]','{}'.format(id))
"""
select json_extract(param,'$.name'), count(json_extract(param,'$.name')) from table
where json_extract(param,'$.name') is not null
group by json_extract(param,'$.name')