Talk:Insert (SQL)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

untitled[edit]

Does anybody know anything about the FIELDS keyword? This actually works in oracle: insert into mytable FIELDS (x,y,z) values(1,2,3); I've been using SQL for 20 years and have never seen it before! I would bet this keyword was used in an early version of Oracle and never taken out. It's certainly not documented nor standard.


—Preceding unsigned comment added by 216.79.87.141 (talk) 18:09, 30 September 2008 (UTC)[reply]

I want to create a new table that have the same structure of an existing table. I don't want the records to be inserted in new table. I want only the structure of existing table.

SQL:2003 says: CREATE TABLE new_table_name [(column_names)] AS <subquery> WITH [NO] DATA. DB2 uses CREATE TABLE new_table_name LIKE old_table_name; both is irrelevant to the INSERT statement, however. --Stolze 10:56, 30 October 2006 (UTC)[reply]

Merge[edit]

Recommend merging UPDATE, INSERT, DELETE, MERGE and SELECT statements into DML article and redirecting these statements there. Comments? SqlPac 05:16, 17 May 2007 (UTC)[reply]

POLICY DEBATE: Use of source code and other examples in articles[edit]

Someone started a policy debate concerning the use of source code in articles, that seems to directly impact this (and possibly other Database articles). See below for details:

I have opened a debate on the use of source code and other examples in Wikipedia articles. It seems that many pieces of example source code etc. currently in Wikipedia violate Wikipedia policy, so we need to either clarify or change the situation. Depending on the result of the discussion, this may result in a number of source code examples being summarily removed from computing articles!

Please reply there, not here, if you wish to contribute.—greenrd 10:50, 18 May 2007 (UTC)[reply]

Thanks.SqlPac 15:08, 18 May 2007 (UTC)[reply]

MS SQL INSERT[edit]

The article claims you have to do something like this for "MS SQL":

INSERT INTO TableName SELECT "somthing", 23

Is MS SQL something different from T-SQL used by SQL Server 2005/2008, because I know you can do this on SQL Server 2005:

INSERT INTO TableName VALUES ('somthing', 23)

MS SQL Multi-Insert[edit]

One can also do multi-inserts using a more friendly syntax

INSERT INTO phone_book VALUES ('John Doe', '555-1212'), ('Peter Doe', '555-2323');

Why is a union construction given as the MS SQL example? Xorlev (talk) 00:45, 25 February 2011 (UTC)[reply]

mysql INSERT with SET[edit]

as far as i know there is another Syntax for INSERT in MySQL it is like

INSERT INTO table_name SET column_1=value_1, column_2=value_2[, column_n=value_n]

please correct me if i am wrong o.O

Karill Endusa (talk) 13:49, 10 June 2010 (UTC)[reply]