Sometimes you wish to copy contents from one table - for instance a backup table - to another table. That can be done using "insert into ... select", here is a simple example:
It will copy the rows from table_source where the col "new" contains 1 as news rows into table_target! Simple backup procedure :-)
INSERT INTO table_target (col1, col2)
select col1, col2 from table_source
where new = 1
No comments:
Post a Comment