tab(rq(日期),je(金額))select nf as 年份,sum(je) as 负的销售额 from
(select to_char(rq,'yyyy') as nf,je from tab
where je<0)
group by 年份
(select to_char(rq,'yyyy') as nf,je from tab
where je<0)
group by 年份
解决方案 »
- oracle 9I 触发器
- oracle 11g em 无法启动!
- 有没有一种格式可以在insert失败后执行update的sql语句
- ORACLE数据库的连接
- 求助sql,不知道有没有这样的写法
- 求SQL语句,高手帮忙啊
- 我在2003中装oracle9i,每次启动都出现agntsrvc.exe错误!怎么处理?
- 8i的菜菜问题!答者给分!多谢多谢!!!
- ORA-25150:altering of extent parameters not permitted
- ORA-12154: TNS:could not resolve the connect identifier specified问题求解
- 简单的sql语句性能问题。
- 求救sequence!!!
能解释一下这句话的意思吗。刚学oracle.
from tab
group by trunc(order_date,'mm')
spid(商品ID),rq(日期),sc(商场),je(金额)
你上次写的那个查询是对的。select decode(sign(to_char(日期,'dd')-25),1,trunc(add_months(日期,1),'mm'),trunc(日期,'mm')),商场,sum(销售额)
from 表1
group by 商场,decode(sign(to_char(日期,'dd')-25),1,trunc(add_months(日期,1),'mm'),trunc(日期,'mm'));
我是想查出,不是正常退货的,即没有买货,而直接冲减我是销售的记录,这就会造成我的销售额过少。
beckhambobo(beckham)
在吗。
帮帮我吧,
谢谢
rq(日期),gz(商场),zje(金额)select A.rq, A.gz,A.zje
from
(select decode(sign(to_char(rqsj,'dd')-25),1,trunc(add_months (rqsj,1),'mm'),trunc(rqsj,'mm')) as rq,
substr( "FUTUREPOS"."XS"."gz",1,2) as gz,
"FUTUREPOS"."XS"."XSE" as zje
from "FUTUREPOS"."XS") A
where ( - A.zje) not in
( select "XSE" from "FUTUREPOS"."XS" where xse>0)没有提示语法错误.就是执行起来速度太慢.
机子配置:P4 2.4 ,内存1GB,