select ht_MaiF2,
(sum(ht_HTmoney)-sum(cast(ht_fk as decimal(18,2)))) as 'ht_WFK',
count(ht_id) as 'ht_Counts',
sum(ht_htmoney) as 'ht_CountMoneys',
sum(cast(ht_fk as decimal(18,2))) as 'ht_YFK',
sum(cast(ht_sk as decimal(18,2))) as 'ht_YKP',
(sum(ht_HTmoney)-sum(cast(ht_sk as decimal(18,2)))) as 'ht_WKP' from tb_ht
where ht_ISemergency='否'
and ht_ISDelete='否'
and ht_FKMX='未归档'
and ht_ty=1
and ht_BeiZ='通过'
and sum(ht_HTmoney)!=sum(cast(ht_fk as decimal(18,2)))
group by ht_maif2
报错的是这一句
and sum(ht_HTmoney)!=sum(cast(ht_fk as decimal(18,2)))
解决方案 »
- asp.net 控件fileupload 一选择一个图片,马上显示在img上面,jquery 如何实现?
- Container.ItemIndex问题
- gridview如何才可以显示html code?
- 怎样在页面布局时采用坐标定位来布局??
- Lucene.net输出结果速度问题
- 关于运行出错问题。。。。。。。。。。。。。。
- 如何防止客户端软件多线程下载文件?
- Web页面水晶报表导出问题,为什么提示“拒绝访问报表文件”问题?
- 在自己机子上开发了web项目,想发布到另一台机子(服务器)进行测试。如何发布
- 急急急!在线等,请高手这边看过来,有关把文件读入数据库的操作
- 从数据库读取数据到gridv中但是页面不显示
- 求教 怎么实现点击 GridView 的一行然后在别的控件中显示这行的相应数据
(sum(ht_HTmoney)-sum(cast(ht_fk as decimal(18,2)))) as 'ht_WFK',
count(ht_id) as 'ht_Counts',
sum(ht_htmoney) as 'ht_CountMoneys',
sum(cast(ht_fk as decimal(18,2))) as 'ht_YFK',
sum(cast(ht_sk as decimal(18,2))) as 'ht_YKP',
(sum(ht_HTmoney)-sum(cast(ht_sk as decimal(18,2)))) as 'ht_WKP' from tb_ht
group by ht_maif2
having ht_ISemergency='否'
and ht_ISDelete='否'
and ht_FKMX='未归档'
and ht_ty=1
and ht_BeiZ='通过'
and sum(ht_HTmoney)!=sum(cast(ht_fk as decimal(18,2)))
HAVING sum(ht_HTmoney)!=sum(cast(ht_fk as decimal(18,2)))
不行哟
消息 8121,级别 16,状态 1,第 1 行
HAVING 子句中的列 'tb_ht.ht_ISemergency' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
消息 8121,级别 16,状态 1,第 1 行
HAVING 子句中的列 'tb_ht.ht_ISDelete' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
消息 8121,级别 16,状态 1,第 1 行
HAVING 子句中的列 'tb_ht.ht_FKMX' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
消息 8121,级别 16,状态 1,第 1 行
HAVING 子句中的列 'tb_ht.ht_ty' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
消息 8121,级别 16,状态 1,第 1 行
HAVING 子句中的列 'tb_ht.ht_BeiZ' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
(sum(ht_HTmoney)-sum(cast(ht_fk as decimal(18,2)))) as 'ht_WFK',
count(ht_id) as 'ht_Counts',
sum(ht_htmoney) as 'ht_CountMoneys',
sum(cast(ht_fk as decimal(18,2))) as 'ht_YFK',
sum(cast(ht_sk as decimal(18,2))) as 'ht_YKP',
(sum(ht_HTmoney)-sum(cast(ht_sk as decimal(18,2)))) as 'ht_WKP' from tb_ht
where ht_ISemergency='否'
and ht_ISDelete='否'
and ht_FKMX='未归档'
and ht_ty=1
and ht_BeiZ='通过'group by ht_maif2 having sum(ht_HTmoney)!=sum(cast(ht_fk as decimal(18,2)))