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