标题:高手帮忙 sql语句
只看楼主
hbutwzc
Rank: 1
等 级:新手上路
威 望:2
帖 子:376
专家分:0
注 册:2008-6-17
结帖率:100%
 问题点数:0 回复次数:3 
高手帮忙 sql语句
use mineBCA
go
SELECT a.MAKTXX as maktxx, Count(a.CHEHAO) AS ch, Sum(a.MZQTY)-Sum(a.PZQTY) as sz, Sum(a.jZQTY) AS jz from (select * from zjlrestmp where Left(CZDAT,8)='20080723' and bfname= '经纬'and BWTAR=0 and pzflag=0 ) as g where MAKTXX='氧化铝' as a group by a.maktxx

在查询分析器中为什么老显示在AS附件有错误,我又找不到在什么地方!
搜索更多相关主题的帖子: sql 语句 Sum MAKTXX 
2008-07-29 09:47
makebest
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:3
帖 子:658
专家分:962
注 册:2005-3-17
得分:0 
where MAKTXX='氧化铝' as a
2008-07-29 10:57
xinzheng
Rank: 1
等 级:新手上路
帖 子:193
专家分:0
注 册:2007-7-22
得分:0 
use mineBCA
go

select MAKTXX,count(CHEHAO) AS ch, Sum(MZQTY)-Sum(PZQTY) as sz, Sum(jZQTY) AS jz from zjlrestmp where Left(CZDAT,8)='20080723' and bfname= '经纬'and BWTAR=0 and pzflag=0 and MAKTXX='氧化铝'  group by MAKTXX
2008-07-29 15:51
hbutwzc
Rank: 1
等 级:新手上路
威 望:2
帖 子:376
专家分:0
注 册:2008-6-17
得分:0 
谢谢各位
我整天已经调试出来了 答案和xinzheng一样
2008-07-30 11:13



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-225657-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.215949 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved