为什么?
不都是plsql一家的吗?
不都是plsql一家的吗?
解决方案 »
- 求一个SQL语句
- 段错误 segmentation fault ?
- oracle 10g 无法登录的问题,高手请进来看看啊!!
- 关于oracle查询的问题(请高手帮小弟一下)
- 关于LIKE中对于%和_的转义字符问题
- 帮我看看TRIGGER哪里写错了?
- 怎么样用SQL语句选择出树形结构中的所有最底层项,也就是说怎么样选择出树形结构中所有最末级项??
- 有人用DVD作为介质进行过备份吗?!
- 今天端午节 祝愿所有IT行业的朋友节日快乐!少些烦恼,多些开心 散分!
- 在sqlplus知道连接的是哪个数据库?
- WebLogic + oracle, 表里数据过多的时候,数据库连接为什么会自动断开...
- 一个很奇怪的,也很难的问题,请求解决!!!!
( select register_no,a.count1
from yk_job_info,(select count(*) count1 from dual) a
where 1 = 2
);
语句原型是下面这样的,我一句一句调,才发现上面那个错误的
(功能:向b表中插入每个登记号两个环节'105''059'传递时间之间的工作日(yk_work_day)天数)
insert into B (register_no , the_days)
select A.register_no,
(select count(*) from yk_work_day where the_date between b.pass_time and a.pass_time )
from
(select register_no,pass_time from yk_app_pass_info where tache_code = '105' ) A,
(select register_no,pass_time from yk_app_pass_info where tache_code = '059' ) B
where A.register_no = B.register_no
;
---------- ----------- -------------------- --------------------
2002-01-01 50 - -
2002-01-02 60 - -
2002-01-05 70 - - insert into test(content2,content3)
select cast(sl as char(10)),
cast ((select count(*) from test) as char(10))
from test DATE SL CONTENT2 CONTENT3
---------- ----------- -------------------- --------------------
2002-01-01 50 - -
2002-01-02 60 - -
2002-01-05 70 - -
- - 50 3
- - 60 3
- - 70 3
我是在存储过程中间出错的啊
你是让我用cast转换一下select count(*)...吗?
我试了,as number(3)错误没有任何变化!
insert into B (register_no , the_days)
select register_no,(select count(1) from yk_work_day where register_no=a.register_no) from yk_work_day a where tache_code between '059' and '105';
yk_work_day (work_day)(工作日表,其实就是把每一天date插入,
然后删除掉那些周末和假期)
B表登记号(pk),天数(number) (统计表)
yk_app_pass_info (登记号、环节号、传递时间)
现在向统计表插入(登记号,天数)这个天数是每个登记号两个特定环节之间的工作日数
( select A.register_no, count(*)
from
(select register_no,pass_time from yk_app_pass_info where tache_code = '105' ) A,
(select register_no,pass_time from yk_app_pass_info where tache_code = '059' ) B,
yk_work_day C
where A.register_no = B.register_no AND c.the_date between b.pass_time and a.pass_time
group by a.register_no
);这样应该可以满足你的要求。