日期:2014-05-17 浏览次数:20562 次
CREATE TABLE #a
(
NAME VARCHAR(20),
Age INT,
)
CREATE TABLE #b
(
NAME VARCHAR(20),
Age INT,
)
INSERT INTO #a
SELECT 'aa',20 UNION ALL
SELECT 'bb',30 UNION ALL
SELECT 'cc',20 UNION ALL
SELECT 'dd',20
--插入到b表中
INSERT INTO #b(name,Age)
SELECT * FROM #a WHERE Age=20
SELECT * FROM #b
------------------------------
NAME Age
-------------------- -----------
aa 20
cc 20
dd 20
(3 row(s) affected)