【发布时间】:2012-11-02 04:48:22
【问题描述】:
来自初学者的简单 PL/SQL 问题:在现有数据集中创建新变量的正确 PL/SQL 语法是什么?
我想从保险索赔数据集 (rpt_claim) 中的日期字段 (svcdat) 中提取年份。日期字段是数字字段,格式为 YYYYMMDD,例如 20120704 表示 2012 年 7 月 4 日。
我第一次创建“年份”变量时失败了:
declare
year number(4);
begin
select svcdat into year
from rpt_claim
where year=floor(svcdat/10000);
end;
非常感谢任何帮助!
【问题讨论】: