select into a table with different column names

The column names do not matter at all, as long as data types match (or can be cast in the assignment).

If the data types of the columns don’t match, try casting the values accordingly. Just try with small dummy tables. Be sure to list the target columns explicitly to avoid confusion. Like this:

INSERT INTO TableB (b1, b2, b3)
SELECT a1, a2, a3
FROM   TableA
WHERE  <some condition>;

More details in the SQLite manual here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)