在 postgresql 执行期间出现以下错误:错误 [HY000] 错误:您只能在目标列表中使用“下一个值”函数
这个sql语句有什么问题:
SELECT TRFCON.ID
,
case when DDDCON.ID_CON = 0
then
NEXT VALUE FOR SEQ_DDD_CON
else
DWHCON.ID_CON
end ID_CON
FROM TTT_CONSUMPTION TTTCON
join DDDDWH_CON DWHCON on TTTCON.ID_ORG = DDDCON.ID_ORG
and TTTCON.ID_PRO = DDDCON.ID_PRO
and TTTCON.ID_REF = DDDCON.ID_REF
该序列的 DDL 如下:
CREATE SEQUENCE SEQ_DDD_CON AS BIGINT
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
NO CYCLE;