Search
 
SCRIPT & CODE EXAMPLE
 

SQL

insert data from another table

#PostgreSQL
INSERT INTO table1 (column11, column12, ...)
SELECT column21, column22, ...
FROM table2
[WHERE condition];
Comment

Insert into table from another table

INSERT INTO table_name (column1, column2, column3) 
SELECT 'Test1', column, 'Test3'
FROM table_name;
Comment

create table and insert values from another table

CREATE TABLE new_table AS
SELECT * 
FROM   old_table;
Comment

PREVIOUS NEXT
Code Example
Sql :: How to get last inserted primary key in SQL Server 
Sql :: consecutive numbers sql 
Sql :: get locked tables sql server 
Sql :: select into 
Sql :: auto increment in postgresql 
Sql :: mysql timezone 
Sql :: select only the month-day from date in PL-SQL 
Sql :: sql example query 
Sql :: sql find leading space 
Sql :: mysql workbench tutorial 
Sql :: between 
Sql :: create foreign key postgres 
Sql :: installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1 
Sql :: Grant privileges of databse to user 
Sql :: update set table column to null 
Sql :: 0 
Sql :: how to search query in python3 sqlite3 
Sql :: initcap in sql 
Sql :: mysql join two tables 
Sql :: php5-mysql has no installation candidate 
Sql :: mysql default uuid 
Sql :: set column width in sqlplus 
Sql :: replace content value from old to new sql 
Sql :: SQL Server OPENJSON FROM table column 
Sql :: like query 
Sql :: partition-by 
Sql :: having clause 
Sql :: dump sql file to database postgres 
Sql :: sqlyog clear cache query 
Sql :: hour must be between 1 and 12 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =