postgresql interval 字段拼接
正确写法:
SELECT scan_time + (5 || ' day')::interval FROM tbl_temp_record
SELECT scan_time + ('-' || 5 || ' day')::interval FROM tbl_temp_record
或
SELECT scan_time + 5*interval '1 day' FROM tbl_temp_record
SELECT scan_time + 5*interval '-1 day' FROM tbl_temp_record
————————————————
版权声明:本文为CSDN博主「宫辰雅轩」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/r_rcgz/article/details/53171256