Try:
INSERT INTO table1 ( column1 )
SELECT col1
FROM table2
This is standard ANSI SQL and should work on any DBMS
It definitely works for:
- Oracle
- MS SQL Server
- MySQL
- Postgres
- SQLite v3
- Teradata
- DB2
- Sybase
- Vertica
- HSQLDB
- H2
- AWS RedShift
- SAP HANA
- Google Spanner
Related Contents:
- How to get a list of column names on Sqlite3 database?
- What’s the difference between CharField and TextField in Django?
- T-SQL Cast versus Convert
- SQL left join vs multiple tables on FROM line?
- SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints
- Strings as Primary Keys in SQL Database [closed]
- The object ‘DF__*’ is dependent on column ‘*’ – Changing int to double
- List all sequences in a Postgres db 8.1 with SQL
- How to do an INNER JOIN on multiple columns
- IN vs OR in the SQL WHERE clause
- How do I alter the position of a column in a PostgreSQL database table?
- SQL query to find record with ID not in another table
- What should I name a table that maps two tables together? [closed]
- SQL ON DELETE CASCADE, Which Way Does the Deletion Occur?
- How to design a database for User Defined Fields?
- Entity Attribute Value Database vs. strict Relational Model Ecommerce
- Database Design for Revisions?
- What are the uses for Cross Join?
- How to select bottom most rows?
- How to get current instance name from T-SQL
- What is a columnar database?
- Difference between LIKE and ~ in Postgres
- Should I commit or rollback a read transaction?
- Do clustered indexes have to be unique?
- How to select unique records by SQL
- Synchronizing client-server databases
- SQLite – ORDER BY RAND()
- How to release possible Postgres row locks?
- What is a Covered Index?
- Oracle DB: How can I write query ignoring case?
- How to select data of a table from another database in SQL Server?
- oracle – what statements need to be committed?
- Generate insert script for selected records?
- What is the syntax meaning of RAISERROR()
- Logging ALL Queries on a SQL Server 2008 Express Database?
- What is the best way to implement soft deletion?
- PostgreSQL Get a random datetime/timestamp between two datetime/timestamp
- Why use SQL database? [closed]
- Why is a primary-foreign key relation required when we can join without it?
- What does =* mean?
- Drop default constraint on a column in TSQL
- Oracle: ‘= ANY()’ vs. ‘IN ()’
- How can I do a BEFORE UPDATED trigger with sql server?
- Why are foreign keys more used in theory than in practice?
- SQL JOIN: is there a difference between USING, ON or WHERE?
- Best table design for application configuration or application option settings?
- Database-wide unique-yet-simple identifiers in SQL Server
- SQLite: COUNT slow on big tables
- Does DB2 have an “insert or update” statement?
- SqlException – The network path was not found