Help on Script, create temp tabkle, copy from table, change, insert table ,drop table?

Good morning,

Im trying to do this, but getting an error on the first line and i cant figure out why ???

CREATE table temporary_tableBEN AS SELECT * FROM GOPLPref WHERE AccNo='ALT001'

UPDATE temporary_tableBEN SET AccNo='AAG001'

INSERT INTO GOPLPref SELECT * FROM temporary_tableBEN

DROP TABLE temporary_tableBEN

Or

INSERT INTO GOPLPref 
SELECT 'AAG001' as  AccNo, *-the other fields
FROM GOPLPref
WHERE AccNo='ALT001'
1 Like

-- Please see this ..

SELECT * into NewTable FROM OldTable

1 Like