如何查询出两个表中的最新10条记录?
A表 字段 id,title,gxtime
B表 字段 id,title,gxtime
根据gxtime排序获得两个表组合的最新10条记录
[解决办法]
- SQL code
select top 10 * from (select * from Aunion all select * from B) torder by t.gxtime desc
发布时间: 2012-09-12 09:21:30 作者: rapoo
如何查询出两个表中的最新10条记录?
A表 字段 id,title,gxtime
B表 字段 id,title,gxtime
根据gxtime排序获得两个表组合的最新10条记录
[解决办法]
select top 10 * from (select * from Aunion all select * from B) torder by t.gxtime desc