我想完成这样一个查询:数据表根据字段A进行分组后的总行数
意思大概等于下面这样两条语句顺序执行:
select A into tmp_table from table group by A
select count(*) from tmp_table
其中这个tmp_table并不存在,我瞎编的,我想一条语句实现不知道怎么写?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你想要这个?
tf_user表按照name字段分组,然后将查询结果作为表cnt_tf_user,最后从cnt_tf_user中查询出总条数。