我试图在Aginity中为Netezza运行一些代码而不将其放在存储过程中,但我无法正确使用语法。以下是一些示例代码。
\set STARTDATE '2016-01-19 00:00:00';
\set ENDDATE '2016-01-19 23:59:59';
select * from LOG where create_time between :STARTDATE and :ENDDATE;
,错误是这样的:
error ^ found“:”(在char 60处)期望标识符找到关键字
答案 0 :(得分:1)
试试这个。
set $startdate = '2016-01-19 00:00:00';
set $enddate = '2016-01-19 23:59:59';
select * from LOG where create_time between $startdate and $enddate;