pc2phone=> select sum(fcall_time),count(fpin) from t_prepaid_history where date_trunc(fcall_start_time)=date_trunc(sysdate-1);
ERROR: Function 'date_trunc(timestamptz)' does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts这句话错在哪里?我想取前一天的值.我现在想做这么一件事,在 linux 中写个脚写,定时去执行刚刚写的那句话,然后输出到一个CSV的文件中去
ERROR: Function 'date_trunc(timestamptz)' does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts这句话错在哪里?我想取前一天的值.我现在想做这么一件事,在 linux 中写个脚写,定时去执行刚刚写的那句话,然后输出到一个CSV的文件中去
ERROR: parser: parse error at or near "("我想将执行后的结果copy到/root/下的a.csv文件中,但提示()出错,请问哪位朋友知道是什么意思?谢谢!
pc2phone=> COPY (select sum(fcall_time),count(fpin) from t_prepaid_history where date_trunc('day',fcall_start_time)=current_date-1) to '/root/a.csv' with csv;
ERROR: parser: parse error at or near "(" 我试着用copy命令执行其它的SQL语句,如:COPY (select * from table) to '/root/a.csv' with csv; 都是正常的,请各位高手指点明确一些,我查了 date_trunc 函数也没发现错在哪里,谢谢各位高手了。
建立一个视图,然后导出,或者临时表