0
有一列planned_duration,以分钟为单位存储时间,其类型为integer。您需要将类型更改为间隔并转换现有数据。为此我写了这个SQL代码:更改列类型和数据转换
ALTER TABLE shift ALTER COLUMN planned_duration TYPE INTERVAL USING planned_duration * INTERVAL '60 sec';
但不幸的是它不起作用。我得到这个错误:
ERROR: operator does not exist: interval >= integer
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
你需要做什么才能正确地更改列类型并转换数据?谢谢。
'SELECT * FROM移位其中planned_duration> 60 * INTERVAL '60秒” ' –