不是幻觉

DROP TABLE test1
GO
DROP TABLE test2
GO
CREATE TABLE test1 (col1 INT, col2 INT)
GO
CREATE TABLE test2 (col3 INT, col4 INT)
GO
INSERT INTO test1 VALUES(1,1)
INSERT INTO test1 VALUES(2,2)
INSERT INTO test1 VALUES(3,3)
INSERT INTO test1 VALUES(4,4)
INSERT INTO test1 VALUES(5,5)
INSERT INTO test2 VALUES(1,1)
INSERT INTO test2 VALUES(2,2)
INSERT INTO test2 VALUES(3,3)
INSERT INTO test2 VALUES(4,4)
INSERT INTO test2 VALUES(5,5)
GO
SELECT * FROM test1
GO
DELETE test1
WHERE col1 IN (SELECT col11 FROM test2 WHERE col4=1)
GO
SELECT * FROM test1
GO
 

posted @ 2012-04-08 14:45  qanholas  阅读(172)  评论(0编辑  收藏  举报