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
More Related Contents:
- Which one of these Queries are wrong and which is correct (SQL) [closed]
- SQL Selecting from three tables
- What’s the best practice for primary keys in tables? [closed]
- What are best practices for multi-language database design? [closed]
- What is atomicity in dbms
- Is there any boolean type in Oracle databases?
- SQLite – How do you join tables from different databases?
- Physical vs. logical (hard vs. soft) delete of database record? [closed]
- MySQL dump by query
- SQL ROWNUM how to return rows between a specific range
- How would you implement sequences in Microsoft SQL Server?
- SQL how to compare two tables for same data content?
- What does =* mean?
- Does MS Access support “CASE WHEN” clause if connect with ODBC?
- MySQL equivalent of DECODE function in Oracle
- What datatype to use when storing latitude and longitude data in SQL databases? [duplicate]
- Do database transactions prevent race conditions?
- Why do NULL values come first when ordering DESC in a PostgreSQL query?
- Favourite performance tuning tricks [closed]
- How do I alter the position of a column in a PostgreSQL database table?
- Is it necessary to create tables each time you connect the derby database?
- Venn Diagram for Natural Join
- Database efficiency – table per user vs. table of users
- How to show row numbers in PostgreSQL query?
- SQL ON DELETE CASCADE, Which Way Does the Deletion Occur?
- Find rows that have the same value on a column in MySQL
- what is the difference between GROUP BY and ORDER BY in sql
- Temporal database design, with a twist (live vs draft rows)
- How do I perform update query with subquery in Access?
- Executing SQL query on multiple databases