关于insert的语句从查询获得数据,并且从序列获得ID,该如何写?

关于insert的语句从查询获得数据,并且从序列获得ID,该如何写?
INSERT INTO ZENGFK.MSG_CONTENT
(MSGCONTET_ID, USER_ID, CREATE_DATE, MSG_CONTENT)
SELECT ZENGFK.CONTENTID_B.NEXTVAL, A.*
FROM (SELECT DISTINCT T.CLIENTID, T.LDATE, T.CONTENT
FROM SMSGATE1.BAK_SMS_SENDINFO_200807 T
ORDER BY T.CLIENTID, T.LDATE) A;


引用楼主 ZengMuAnSha 的帖子:
INSERT INTO ZENGFK.MSG_CONTENT(msgcontet_id,USER_ID,CREATE_DATE,MSG_CONTENT)
VALUES (ZENGFK.CONTENTID_B.NEXTVAL,select distinct t.clientid,t.ldate,t.content
from smsgate1.bak_sms_sendinfo_200807 t order byt.clientid,t.ldate)

你可能感兴趣的:(关于insert的语句从查询获得数据,并且从序列获得ID,该如何写?)