select substr(to_char(t.grosstime,'yyyy-mm-dd'),9,10) as dates ,
sum(decode(varno, '0102010105000000', netweight,0)) "JMton",
sum(case when t.borrowflag='0'and t.varno='0102010105000000'then 1 else 0 end) as "JMnum",
from table_1 t
where to_char(t.grosstime, 'yyyy-mm') = '2010-10' and t.minecode="150000" and t.transway='1' and t.flag='1'
group by substr(to_char(t.grosstime,'yyyy-mm-dd'),9,10)
order by substr(to_char(t.grosstime,'yyyy-mm-dd'),9,10)用plsql执行没问题,在报表中就报缺少右括号主要就是第三行case when,该怎么办呢?
sum(decode(varno, '0102010105000000', netweight,0)) "JMton",
sum(case when t.borrowflag='0'and t.varno='0102010105000000'then 1 else 0 end) as "JMnum",
from table_1 t
where to_char(t.grosstime, 'yyyy-mm') = '2010-10' and t.minecode="150000" and t.transway='1' and t.flag='1'
group by substr(to_char(t.grosstime,'yyyy-mm-dd'),9,10)
order by substr(to_char(t.grosstime,'yyyy-mm-dd'),9,10)用plsql执行没问题,在报表中就报缺少右括号主要就是第三行case when,该怎么办呢?
解决方案 »
- javascript点击按钮带参数提交
- jspsmart的导入
- struts2+hibernate+spring整合错误
- 什么是NETBEANS ??????????????????????
- 搞不懂啊线程的基本概念
- 在线急等!如何在网页上调用本地的计算器
- 求教jrun 4 中与sqlserver的jdbc联接如何配置???
- 问个简单白痴的问题??JAVA里面怎么来实现堆栈操作,不用现成的类库??多谢了!!!
- 请问有没有使用jsp:plugin将一个可视化bean组件放到jsp上面成功的例子 ?
- 急!跪求大神指导菜鸟做毕业设计考试系统随机从试题库中生成试卷!
- struts2标签如何遍历List<String>
- 如何在input type="text" 文本框里显示数据库的值,我要做信息修改
第3行末尾多个逗号
第2行似乎写得也不够工整。
sum(decode(varno, '0102010105000000', netweight, 0)) as JMton,
sum(case
when t.borrowflag = '0' and t.varno = '0102010105000000' then
1
else
0
end) as "JMnum",
from table_1 t
where to_char(t.grosstime, 'yyyy-mm') = '2010-10'
and t.minecode = "150000"
and t.transway = '1'
and t.flag = '1'
group by substr(to_char(t.grosstime, 'yyyy-mm-dd'), 9, 10)
order by substr(to_char(t.grosstime, 'yyyy-mm-dd'), 9, 10)