DML:INSERT, DELETE, UPDATE, SELECT
創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供廣昌網(wǎng)站建設(shè)、廣昌做網(wǎng)站、廣昌網(wǎng)站設(shè)計(jì)、廣昌網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、廣昌企業(yè)網(wǎng)站模板建站服務(wù),十年廣昌做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
INSERT INTO:
INSERT [INTO] tbl_name [(col1,...)] {VALUES|VALUE} (val1, ...),(...),...
注意:
字符型:引號(hào);
數(shù)值型:不能用引號(hào);
SELECT:
(1) SELECT * FROM tbl_name;
(2) SELECT col1, col2, ... FROM tbl_name;
顯示時(shí),字段可以顯示為別名;
col_name AS col_alias
(3) SELECT col1, ... FROM tbl_name WHERE clause;
WHERE clause:用于指明挑選條件;
col_name 操作符 value:
age > 30;
操作符(1) :
>, <, >=, <=, ==, !=
組合條件:
and
or
not
操作符(2) :
BETWEEN ... AND ...
LIKE 'PATTERN'
通配符:
%:任意長(zhǎng)度的任意字符;
_:任意單個(gè)字符;
RLIKE 'PATTERN'
正則表達(dá)式對(duì)字符串做模式匹配;
IS NULL
IS NOT NULL
(4) SELECT col1, ... FROM tbl_name [WHERE clause] ORDER BY col_name, col_name2, ... [ASC|DESC];
ASC: 升序;
DESC: 降序;
DELETE:
DELETE FROM tbl_name [WHERE where_condition] [ORDER BY ...] [LIMIT row_count] (1) DELETE FROM tbl_name WHERE where_condition
(2) DELETE FROM tbl_name [ORDER BY ...] [LIMIT row_count]
UPDATE:
UPDATE [LOW_PRIORITY] [IGNORE] table_reference SET col_name1=value1 [, col_name2=value2] ... [WHERE where_condition] [ORDER BY ...] [LIMIT row_count]