急求一SQL语句? 我来个效率比较差的select count( select code distinct from table where type=1), count( select code distinct from table where type=0) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select type, count(*) count from (select distinct type, code from table) A 不好意思,少写了group byselect type, count(*) count from (select distinct type, code from table) A group by type 呵呵 我自己也捣鼓出来了(和NoThiNg2050(子虚乌有)的答案一样):谢谢两位的回复select count(*) as count from (select distinct type,code from table) as tongji group by type; 如何转’为单引号? string(381) "array ( 'title' => '这个字符怎么转成数组',) 搞了很久没有成功~有人帮我调试一个采集程序吗 保护网页内容防止复制、另存、拷屏、打印等 后台新闻发布系统生成静态页面的问题 为什么回调函数在array_filter()里面没有起作用? 如何将某个目录下的全部文件都写上一段注释,同时。 菜鸟的安装问题! 伪静态问题--首页跳转 php怎么发websocket? 高分急求mysql innodb的数据恢复问题 熬了一夜也没想通的问题,在线等
select type, count(*) count from (select distinct type, code from table) A group by type
select count(*) as count from (select distinct type,code from table) as tongji group by type;