日期:2014-05-16 浏览次数:20404 次
CREATE TABLE TEST( ID NUMBER NOT NULL, NAME VARCHAR2(30) NOT NULL, SEX VARCHAR2(2) DEFAULT '男' )
INSERT INTO TEST VALUES(1,'SUNZHENXING','男') INSERT INTO TEST VALUES(2,'SUNHAILONG','女')
MERGE INTO TEST A USING TEST B ON (A.NAME=B.NAME) WHEN MATCHED THEN UPDATE SET A.SEX='女'WHERE A.NAME='SUNZHENXING' WHEN NOT MATCHED THEN INSERT VALUES (3,'SUNZHENXING','女')