成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

INSERT 中文man頁面

系統(tǒng)
INSERT 允許我們向表中插入新行。 我們可以一次插入一行或多行作為查詢結果。

NAME

INSERT - 在表中創(chuàng)建新行

SYNOPSIS

INSERT INTO table [ ( column [, ...] ) ]
    { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) | query }

DESCRIPTION 描述

INSERT 允許我們向表中插入新行。 我們可以一次插入一行或多行作為查詢結果。


 目標列表中的列/字段可以按任何順序排列。 在目標列中沒有出現(xiàn)的列/字段將插入缺省值, 可能是定義了的缺省值或者 NULL。


 如果每行的表達式不是正確的數(shù)據(jù)類型,系統(tǒng)將試圖進行自動的類型轉(zhuǎn)換。


 要想向表中插入數(shù)據(jù),你必須有 INSERT 權限, 如果你使用了 query 子句插入來自查詢里的數(shù)據(jù)行, 你還需要擁有在查詢里使用的表的 SELECT 權限。  

PARAMETERS 參數(shù)

table

 現(xiàn)存表的名稱(可以有模式修飾)。
column

 表 table 中的字段名。
DEFAULT VALUES

 所有字段都會用它們的缺省值填充。
expression

 賦予 column 的一個有效表達式或值。
DEFAULT

 這個字段將被字段它的填充。
query

 一個查詢(SELECT 語句),它提供插入的數(shù)據(jù)行。 請參考 SELECT 語句獲取語法描述。

OUTPUTS 輸出


 成功完成后,一條 INSERT 命令返回一個下面形式的命令標簽

INSERT oid count

count 是插入的行數(shù)。 如果 count 正好是一,并且目標表有 OID, 那么 oid 是賦予插入行的 OID。 否則 oid 是零。  

EXAMPLES 例子


 向表 films 里插入一行:

INSERT INTO films VALUES
    ('UA502', 'Bananas', 105, '1971-07-13', 'Comedy', '82 minutes');


 在第二個例子里面省略了字段 len  因此在它里面將只存儲缺省的 NULL 值:

INSERT INTO films (code, title, did, date_prod, kind)
    VALUES ('T_601', 'Yojimbo', 106, '1961-06-16', 'Drama');


 在第三個例子里,我們用 DEFAULT 值作為數(shù)據(jù)字段,而不是聲明一個數(shù)值:

INSERT INTO films VALUES
    ('UA502', 'Bananas', 105, DEFAULT, 'Comedy', '82 minutes');
INSERT INTO films (code, title, did, date_prod, kind)
    VALUES ('T_601', 'Yojimbo', 106, DEFAULT, 'Drama');


 從表 tmp 中插入幾行到表 films 中:

INSERT INTO films SELECT * FROM tmp;


 插入數(shù)組:

-- 創(chuàng)建一個空的 3x3 游戲板來玩圈-和-叉游戲
-- (所有這些查詢創(chuàng)建相同的游戲)
INSERT INTO tictactoe (game, board[1:3][1:3])
    VALUES (1,'{{"","",""},{},{"",""}}');
INSERT INTO tictactoe (game, board[3][3])
    VALUES (2,'{}');
INSERT INTO tictactoe (game, board)
    VALUES (3,'{{,,},{,,},{,,}}');

COMPATIBILITY 兼容性

INSERT 完全遵循 SQL 標準。可能碰到的關于 query 子句特性的限制在 SELECT [select(7)] 語句中有相關文檔。  

#p#

NAME

INSERT - create new rows in a table

SYNOPSIS

INSERT INTO table [ ( column [, ...] ) ]
    { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) | query }

DESCRIPTION

INSERT allows one to insert new rows into a table. One can insert a single row at a time or several rows as a result of a query.

The columns in the target list may be listed in any order. Each column not present in the target list will be inserted using a default value, either its declared default value or null.

If the expression for each column is not of the correct data type, automatic type conversion will be attempted.

You must have INSERT privilege to a table in order to insert into it. If you use the query clause to insert rows from a query, you also need to have SELECT privilege on any table used in the query.  

PARAMETERS

table
The name (optionally schema-qualified) of an existing table.
column
The name of a column in table.
DEFAULT VALUES
All columns will be filled with their default values.
expression
An expression or value to assign to column.
DEFAULT
This column will be filled with its default value.
query
A query (SELECT statement) that supplies the rows to be inserted. Refer to the SELECT statement for a description of the syntax.

OUTPUTS

On successful completion, an INSERT command returns a command tag of the form

INSERT oid count

The count is the number of rows inserted. If count is exactly one, and the target table has OIDs, then oid is the OID assigned to the inserted row. Otherwise oid is zero.  

EXAMPLES

Insert a single row into table films:

INSERT INTO films VALUES
    ('UA502', 'Bananas', 105, '1971-07-13', 'Comedy', '82 minutes');

In this second example, the last column len is omitted and therefore it will have the default value of null:

INSERT INTO films (code, title, did, date_prod, kind)
    VALUES ('T_601', 'Yojimbo', 106, '1961-06-16', 'Drama');

The third example uses the DEFAULT clause for the date columns rather than specifying a value:

INSERT INTO films VALUES
    ('UA502', 'Bananas', 105, DEFAULT, 'Comedy', '82 minutes');
INSERT INTO films (code, title, did, date_prod, kind)
    VALUES ('T_601', 'Yojimbo', 106, DEFAULT, 'Drama');

This examples inserts several rows into table films from table tmp:

INSERT INTO films SELECT * FROM tmp;

This example inserts into array columns:

-- Create an empty 3x3 gameboard for noughts-and-crosses
-- (all of these commands create the same board)
INSERT INTO tictactoe (game, board[1:3][1:3])
    VALUES (1,'{{"","",""},{},{"",""}}');
INSERT INTO tictactoe (game, board[3][3])
    VALUES (2,'{}');
INSERT INTO tictactoe (game, board)
    VALUES (3,'{{,,},{,,},{,,}}');

COMPATIBILITY

INSERT conforms fully to the SQL standard. Possible limitations of the query clause are documented under SELECT [select(7)].

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:18:19

head中文man

2011-08-12 13:49:23

hostid中文man

2011-08-12 13:54:46

hostname中文man

2011-08-12 14:53:56

kill中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 99久久精品免费看国产高清 | 国产在线视频一区二区 | 日韩成人精品一区 | 欧美精品一区三区 | 免费久久精品 | 精品国产视频 | 一区二区三区在线免费观看视频 | 精品视频免费 | 一级毛片在线看 | 国产成人99久久亚洲综合精品 | 91久久久久久久久 | 日韩av成人 | 精品国产一区三区 | 亚洲一区二区中文字幕 | 先锋资源亚洲 | 欧美一级欧美三级在线观看 | 精品国产一级 | 99久久免费精品 | 亚洲综合日韩精品欧美综合区 | 精品91av| 国产成人福利在线观看 | 成人一区二区三区 | 91高清在线观看 | 在线视频成人 | 国产精品视频999 | 一级做a爰片久久毛片 | 亚洲在线 | 国产福利91精品一区二区三区 | 三级在线观看 | 欧美激情综合 | 久久精品亚洲国产奇米99 | 国产精品视频免费看 | 亚洲欧美综合精品久久成人 | 国产精品视频一区二区三区不卡 | 日韩高清中文字幕 | 久久久久久影院 | 国产十日韩十欧美 | av免费在线播放 | 久久久成 | 一级做a爰片性色毛片16美国 | 国内久久精品 |