日期:2014-05-16 浏览次数:20448 次
SELECT Name,Age FROM Teacher ORDER BY Name UNION SELECT Name,Age FROM Student ORDER BY Name
SELECT * FROM (SELECT TOP 99.999999 PERCENT Name,Age FROM Teacher ORDER BY Name) A UNION SELECT * FROM (SELECT TOP 99.999999 PERCENT Name,Age FROM Student ORDER BY Name) B
(SELECT 1 as type, t.Name,t.Age FROM Teacher t) UNION (SELECT 2 as type, s.Name,s.Age FROM Student s) ORDER BY type,Name