私はテーブルを持っています:
create table detailids(detail_id integer);
私はこれをやろうとしています:
insert into detailids ( insert into another_table(a bunch of values)
(select id from temp_table where temp_table.type = 'smth')
returning id);
私はこのエラーが発生します:
ERROR: syntax error at or near "insert"
構文が機能しない理由がわかりません! Postgresのドキュメントによると:
INSERT コマンドに RETURNING 句が含まれている場合、結果は、コマンドによって挿入された行に対して計算された、RETURNING リストで定義された列と値を含む SELECT ステートメントの結果と同様になります。
また、特定の列名を指定して実行しようとしましたがdetailids(detail_id)
、役に立ちません! どうして?!?
読んでくれてありがとう。