我正在查询 postgresql 数据库。那么应该如何写日期以使其不计为整数呢?为什么它给我这个错误:
ERROR: ОШИБКА: привести тип integer к date нельзя
LINE 3: and start_date > cast(2020-03-12 AS date)
编码
select * from contract
WHERE id = 6
and start_date > CAST(2020-03-12 AS date)
and start_date < cast(2020-03-19 as date) + interval '1' day
我猜的。你需要放单引号,它们包含日期