sql server我用union all来进行两张表的查询合并,例如:

slect * from table1 where id='1' union all select* from table2 where id='2',这只是一个例子,现在输入结果了,我要把这些结果取出前10条,要用到top语句,怎么写?
select top 10 * from(slect * from table1 where id='1' union all select* from table2 where id='2')就出错了,我数据库学的不好,求教。。。

第1个回答  2013-08-09
在你写的语句末尾加as a表别名即可本回答被提问者采纳
相似回答