Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
と の列を持つ単一のテーブルがst_nameありますid。のカウントst_nameと Group byを取得する必要がありst_nameます。どうすればいいですか?
st_name
id
select st_name, count(*) as grp_cnt, (select count(distinct st_name) from your_table) as st_cnt from your_table group by st_name