Top "Insert-select" questions

Use this tag for questions concerning INSERT, the SQL command which inserts data into a table using a SELECT query.

INSERT with SELECT

I have a query that inserts using a select: INSERT INTO courses (name, location, gid) SELECT name, location, gid FROM …

mysql sql insert-select
MySql Insert Select uuid()

Say you have a table: `item` With fields: `id` VARCHAR( 36 ) NOT NULL ,`order` BIGINT UNSIGNED NOT NULL And: Unique(`id`) …

mysql uuid insert-select
SQLITE equivalent for Oracle's ROWNUM?

I'm adding an 'index' column to a table in SQLite3 to allow the users to easily reorder the data, by …

sqlite insert-select
How to select and insert values in mysql using stored procedures

I am new in using stored procedures. I have this query that gets values from tables. After that, I need …

mysql sql sql-server stored-procedures insert-select
SQL Server error: "Cannot insert explicit value for identity column" even when I SET IDENTITY_INSERT ON

I REALLY review several times, that's the reason I am asking; looking for guidance... I have one table, as the …

sql sql-server sql-server-2012 insert insert-select
INSERT INTO.....SELECT FROM

i want to put calory as the first value of fruits, i couldn't do it, can anyone help? $sql = 'INSERT …

php codeigniter insert-select
MySQL Stored Procedure with Insert Select and user variable

Problem: I have a MySQL stored procedure and I want to reset a user variable to 0 each time the procedure …

mysql sql stored-procedures insert-select user-variables
SQL: Copy one row multiple times, changing one value each time

I have a row of data in a table: Key | Val1 | Val2 ----+------+----- 1 | A | B I would like …

sql insert-select