简体   繁体   English

使用SAS功能执行TeraData代码

[英]Executing TeraData codes using SAS function

I have a question about executing the year() function in TeraData from SAS. 我对从SAS在TeraData中执行year()函数有疑问。 For example, when executing the code below, I will get the error message below the codes. 例如,当执行下面的代码时,我将在代码下面得到错误消息。 Is there a way to execute the year() function besides using the year function in SAS after the table is created from TeraData? 从TeraData创建表后,除了在SAS中使用year函数之外,还有其他方法可以执行year()函数吗?

 select * from connection to teradata (
      select customer_id
           , year(date)
      from base.customers a
  );


ERROR: Teradata execute: Syntax error: expected something between ',' and the 'year' keyword

You are getting an error because there is no YEAR function in Teradata. 您收到错误,因为Teradata中没有YEAR函数。 Instead you can use Extract() : 相反,您可以使用Extract()

 select * from connection to teradata (
      select customer_id
           , EXTRACT(YEAR FROM date)
      from base.customers a
  );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM