Sql Select Into

An sql select into returns a set of data records and at the same time, it inserts the data to a different table.
That is while selecting a table, we insert the copy of table into another table.

SELECT * INTO table_to_backup FROM source_table

SQL Select Into Code Sample

SELECT * INTO tbl_users_backup FROM tbl_users

This sql select into query will select the data from the tbl_users table, and insert them into tbl_users_backup.


SQL select into can be used for backup operations.