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秒」 ' –