たとえば、次の値を持つ ingres db 内にテーブルがあります
grd gsd Name Location
112 04 Joe Test
同じデータがコピーされた新しい行を作成したいが、「grd」値は以下のような新しい値に変更された
grd gsd Name Location
113 04 Joe Test
最適化されたSQLステートメントでこれを達成するにはどうすればよいですか?
次のようなことを試してください:
INSERT INTO your_table (grd, gsd, Name, Location)
SELECT
grd,--or change it here as you need (for example replacing with value 113)
gsd,
Name,
Location
FROM your_table
--WHERE some condition (e.g. grd = 112)
insert into MyTable(field1, field2, "113")
select field1, field2, grd from MyTable where grd = "112";