错误:Teradata 准备:在 SAS 中使用日期格式“ddmmyyy”时出现语法错误
我正在使用此代码从该数据库中提取信息。但是,它向我显示了这个错误:
错误:Teradata 准备:语法错误,字符串或 Unicode 字符文字与单词之间应出现类似“)”的内容 'd'。 SQL 语句为:WITH vmher102ult as ( select cod_cte, max(fec_consulta) as max_fec_consulta from klarmxpw_her.vmher102 其中 cod_cte 不在 ('','0','00000000') 中并且 fec_consulta>='01MAR2021'd 按 cod_cte 分组) 选择 t1.* 从 klarmxpw_her.vmher101 作为 t1 内部连接 vmher102ult 作为 t2 在 t1.cod_cte=t2.cod_cte 上并且 t1.fec_consulta=t2.max_fec_consulta。
我用于此传递的代码如下:
proc sql;
connect to teradata as tera (user=&tuser. password=&tpass. server='TDMX03');
create table vmher101_m as
select * from connection to tera (
WITH vmher102ult as (
select cod_cte, max(fec_consulta) as max_fec_consulta
from klarmxpw_her.vmher102
where cod_cte not in ('','0','00000000')
and fec_consulta>='01MAR2021'd
group by cod_cte)
select t1.*
from klarmxpw_her.vmher101 as t1
inner join vmher102ult as t2
on t1.cod_cte=t2.cod_cte and t1.fec_consulta=t2.max_fec_consulta);
disconnect from ter;
有人知道我能做什么吗?
I'm using this code to extract information from this database. However, it is showing me this error:
ERROR: Teradata prepare: Syntax error, expected something like ')' between a string or a Unicode character literal and the word
'd'. SQL statement was: WITH vmher102ult as ( select cod_cte, max(fec_consulta) as max_fec_consulta from
klarmxpw_her.vmher102 where cod_cte not in ('','0','00000000') and fec_consulta>='01MAR2021'd group by cod_cte) select t1.*
from klarmxpw_her.vmher101 as t1 inner join vmher102ult as t2 on t1.cod_cte=t2.cod_cte and
t1.fec_consulta=t2.max_fec_consulta.
The code I'm using for this pass through is the following:
proc sql;
connect to teradata as tera (user=&tuser. password=&tpass. server='TDMX03');
create table vmher101_m as
select * from connection to tera (
WITH vmher102ult as (
select cod_cte, max(fec_consulta) as max_fec_consulta
from klarmxpw_her.vmher102
where cod_cte not in ('','0','00000000')
and fec_consulta>='01MAR2021'd
group by cod_cte)
select t1.*
from klarmxpw_her.vmher101 as t1
inner join vmher102ult as t2
on t1.cod_cte=t2.cod_cte and t1.fec_consulta=t2.max_fec_consulta);
disconnect from ter;
Does anybody know what can I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在
从连接到tera
之后的()内使用TERADATA代码。尝试
Teradata 文档
You need to use TERADATA code inside the () after
from connection to tera
.Try
Teradata Documentation