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 :: postgresql how to show table names 
Sql :: create new table from existing table with data in sql server 
Sql :: mysql backup query 
Sql :: sql check double value 
Sql :: sql server set variable if exists 
Sql :: psql connect as user with password 
Sql :: delete top N rows in sql 
Sql :: delete temp table if exists 
Sql :: get count of duplicate records 
Sql :: postgres populate table from another table 
Sql :: round one decimal place mysql 
Sql :: calculate age in sql postgresql 
Sql :: mysql set id auto increment 
Sql :: mysql get year from date 
Sql :: sql server select value large text 
Sql :: get primary key of table 
Sql :: SQL COUNT() with DISTINCT 
Sql :: how to get the date diff on once field in sql server 
Sql :: display 2 numbers after decimal mysql 
Sql :: drop index in sql 
Sql :: sql_calc_found_rows 
Sql :: create table in microsoft sql server 
Sql :: create_engine sqlalchemy with parsed url sql server 
Sql :: mysql show all table from database 
Sql :: alter table add multiple foreign key sql 
Sql :: mysql ip address 
Sql :: how to combine first and last nae into one columb sql 
Sql :: how to retrive the today date sql 
Sql :: remove space in sql server 2012 
Sql :: codigo crear tablas sql server 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =