我现在有一张表字段分别是“
companyname 状态(querystate) productname 等等现在我要写一个查询语句既要把公司的总数统计出来,又要算出状态为1的公司呢?我写了一条语句 麻烦各位大哥帮忙看看为什么不行,请各位高手指教!select companyname,count(companyname),querystate,count(querystate) , count(QueryState)as msg2 from productcode group by companyname ,querystate
companyname 状态(querystate) productname 等等现在我要写一个查询语句既要把公司的总数统计出来,又要算出状态为1的公司呢?我写了一条语句 麻烦各位大哥帮忙看看为什么不行,请各位高手指教!select companyname,count(companyname),querystate,count(querystate) , count(QueryState)as msg2 from productcode group by companyname ,querystate
解决方案 »
- 求助:MPEG-2视频中I帧的提取
- 看完后你不发疯,I服了YOU!
- 请教:如何获取View的句柄!
- select * from table where xx like '%value%"',如何不区分大小写查询呀?
- 关于创建目录问题的一点困惑,求教!
- InvalidateRect为什么没有作用?
- @@@在线等待--<<设计模式>>的源代码怎么没有包含书上的例子?
- 如何修改 ListBox 中一个 Item 的文字?
- 关于软件发布的问题`
- 【求助】把CString转unsigned char的方法,谢谢
- typedef struct的问题---在线等,解决就给分
- 在htmlview中显示网页,如何去掉右键菜单!
select count(companyname) from productcode //取得总数
select count(querystate) from productcode where =1querystate=1
select count(companyname) as 公司总数,count(querystate)as 状态
from productcode
where querystate='1'
group by querystate
select count(querystate) as 状态 from productcode where querystate='1' group by querystate