救命呀,看看我的视图哪里有错呀create or replace view accounting_balance_fymx as
select
sum(case when account=4101010815 then debet_balance end) BanGongFei,
sum(case when account=4101010814 then debet_balance end) YunShuFei,
sum(case when account=218110 then debet_balance end) GongHuiFei,
sum(case when account=218123 then debet_balance end) ZhiJiaoFei,
sum(case when account=218102 then debet_balance end) Yanglaobaoxian,
sum(case when account=218103 then debet_balance end) jibenyiliaobaoxian,
sum(case when account=218101 then debet_balance end) zhufanggongjijin,
sum(case when account=218104 then debet_balance end) shiyebaoxian,
sum(case when account=218113 then debet_balance end) gongshangbaoxian,
sum(case when account=218112 then debet_balance end) shengyubaoxian,
sum(case when account=217113 then debet_balance end) yinhuashui,
sum(case when account=217111 then debet_balance end) chechuanshui,
sum(case when account=217110 then debet_balance end) tudishui,
sum(case when account=217109 then debet_balance end) fangchanshui,
accounting_year,
accounting_period,
rowid objid,
ltrim(lpad(to_char(sysdate,'YYYYMMDDHH24MISS'),2000)) objversion
from
accounting_balance_tab
where
accounting_year=2006
and accounting_period=9
group by
accounting_year,
accounting_period,
rowid我要的结果是只要一条数据,
可是加上rowid后
我的结果就出来了一堆的数据,好多,不止一条
但是不加 rowid,我的视图就报错,
有没有兄弟给指点一下,谢谢
select
sum(case when account=4101010815 then debet_balance end) BanGongFei,
sum(case when account=4101010814 then debet_balance end) YunShuFei,
sum(case when account=218110 then debet_balance end) GongHuiFei,
sum(case when account=218123 then debet_balance end) ZhiJiaoFei,
sum(case when account=218102 then debet_balance end) Yanglaobaoxian,
sum(case when account=218103 then debet_balance end) jibenyiliaobaoxian,
sum(case when account=218101 then debet_balance end) zhufanggongjijin,
sum(case when account=218104 then debet_balance end) shiyebaoxian,
sum(case when account=218113 then debet_balance end) gongshangbaoxian,
sum(case when account=218112 then debet_balance end) shengyubaoxian,
sum(case when account=217113 then debet_balance end) yinhuashui,
sum(case when account=217111 then debet_balance end) chechuanshui,
sum(case when account=217110 then debet_balance end) tudishui,
sum(case when account=217109 then debet_balance end) fangchanshui,
accounting_year,
accounting_period,
rowid objid,
ltrim(lpad(to_char(sysdate,'YYYYMMDDHH24MISS'),2000)) objversion
from
accounting_balance_tab
where
accounting_year=2006
and accounting_period=9
group by
accounting_year,
accounting_period,
rowid我要的结果是只要一条数据,
可是加上rowid后
我的结果就出来了一堆的数据,好多,不止一条
但是不加 rowid,我的视图就报错,
有没有兄弟给指点一下,谢谢
解决方案 »
- 存储过程没执行一个update以后都commit了,请问rollback会把commit的数据回滚不?
- 关于ORACLE死锁
- 怎么解决ORA-01034和ORA-27101啊?
- 如何能够按照千行以上的SN查询数据???
- memo类型问题?
- 请教oracle 安装的问题
- 求教语句,(在线)
- 怎样在vc中用odbc加载日期型数据?急!
- 很简单的存储过程(SQL Server2000转到Oracle8),比较急,在线等
- 创建视图时,遇到一个问题(列的求和不成功):请教各位兄弟姐妹
- 在EXEC SQL BEGIN DECLARE SECTION 中定义的char 类型数组的问题?为什么char sSQL[SQL_LEN]这样定义会抱错?
- 一个update语句不会写了!寻求帮助!
create or replace view accounting_balance_fymx as
select
sum(case when account=4101010815 then debet_balance end) BanGongFei,
sum(case when account=4101010814 then debet_balance end) YunShuFei,
sum(case when account=218110 then debet_balance end) GongHuiFei,
sum(case when account=218123 then debet_balance end) ZhiJiaoFei,
sum(case when account=218102 then debet_balance end) Yanglaobaoxian,
sum(case when account=218103 then debet_balance end) jibenyiliaobaoxian,
sum(case when account=218101 then debet_balance end) zhufanggongjijin,
sum(case when account=218104 then debet_balance end) shiyebaoxian,
sum(case when account=218113 then debet_balance end) gongshangbaoxian,
sum(case when account=218112 then debet_balance end) shengyubaoxian,
sum(case when account=217113 then debet_balance end) yinhuashui,
sum(case when account=217111 then debet_balance end) chechuanshui,
sum(case when account=217110 then debet_balance end) tudishui,
sum(case when account=217109 then debet_balance end) fangchanshui,
accounting_year,
accounting_period,
ltrim(lpad(to_char(sysdate,'YYYYMMDDHH24MISS'),2000)) objversion
from
accounting_balance_tab
where
accounting_year=2006
and accounting_period=9
group by
accounting_year,
accounting_period,
ltrim(lpad(to_char(sysdate,'YYYYMMDDHH24MISS'),2000))
你改成这样看看