oracle给变量赋值的问题
Cycle:=WITHPARAMSAS(SELECTYearCycle-1ASNFFROMDUAL)SELECTTO_CHAR(TO_DATE(PM.NF||'-12-2...
Cycle:=WITH PARAMS AS (SELECT YearCycle-1 AS NF FROM DUAL) SELECT TO_CHAR(TO_DATE(PM.NF || '-12-28','YYYY-MM-DD'),'IYYYIW') as a FROM DUAL LEFT JOIN PARAMS PM ON 1=1;
想给Cycle这个变量赋with的这个结果,请问怎么写
现在是报
错误:PLS-00103: 出现符号 "WITH"在需要下列之一时:
( - + case 展开
想给Cycle这个变量赋with的这个结果,请问怎么写
现在是报
错误:PLS-00103: 出现符号 "WITH"在需要下列之一时:
( - + case 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
2个回答
展开全部
参考如下:
declare
t_cycle varchar2(10);
begin
with temp_t as(
SELECT 'aa' as t_a
FROM dual)
SELECT 'bb' || t.t_a as t_b
into t_cycle
FROM dual
left join temp_t t on 1 = 1;
dbms_output.put_line(t_cycle);
end;
declare
t_cycle varchar2(10);
begin
with temp_t as(
SELECT 'aa' as t_a
FROM dual)
SELECT 'bb' || t.t_a as t_b
into t_cycle
FROM dual
left join temp_t t on 1 = 1;
dbms_output.put_line(t_cycle);
end;
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询