This MySQL version supports INSERT INTO ... SELECT, but it doesn't work in this case since something like
INSERT INTO thetable (fieldlist) SELECT fieldlist FROM thetable
is invalid. The table names must differ, you can't insert data into a table selected from the same table.
Solutions:
- use a temporary table ... overkill
- fetch the record and afterwards insert the record
3.
Create an archive table like tblDocumentArchive with the same structure, then do something like INSERT INTO tblDocumentArchive SELECT * FROM tblDocument WHERE lngDocumentID='<theid>'
Update the record in the document table afterwards.
Do you store documents and archived versions in the same table ?
Thomas