abcd表中只有一条记录吗?那干嘛还要设那么多的表啊。
解决方案 »
- 表的主键设置为自动编号也会出现主键冲突的错误?
- 在线等 一个SQL 的替换问题
- 个别字段无法显示
- SQL Server2005怎么样安装在windows XP上面?
- 取当前日期 到 前3个月的记录 怎么写 谢谢
- 老调重弹分页存储过程
- 请问这个SQL查询应该怎么写比较好?
- 有句sql不知怎么写,高手帮忙!
- 备份数据库,解决马上给分
- 我想知道在vb中怎样向sql server的数据库中输入图片,并且此时我sql server中的数据类型是什么?最好是两种以上的方法,越简单越好,拜托了!
- 求一个负杂的SQL问题解决方法,连接查询、分组、按平均值排序。
- sql2000 自动增长id,怎样更新重用被删除过的id
-->try
select top 13 *
from
(select e.栏目名,a.title,a.[time],a.titleurl from a表 a join e表 e on a.栏目id=e.栏目id union all
select e.栏目名,b.title,b.[time],b.titleurl from b表 b join e表 e on b.栏目id=e.栏目id union all
select e.栏目名,c.title,c.[time],c.titleurl from c表 c join e表 e on c.栏目id=e.栏目id union all
select e.栏目名,c.title,c.[time],c.titleurl from d表 d join e表 e on d.栏目id=e.栏目id ) t
order by [time] desc
-->楼上的逗号用的是中文的,这里纠正一下
select top 13 *
from
(select e.栏目名,a.title,a.[time],a.titleurl from a表 a join e表 e on a.栏目id=e.栏目id union all
select e.栏目名,b.title,b.[time],b.titleurl from b表 b join e表 e on b.栏目id=e.栏目id union all
select e.栏目名,c.title,c.[time],c.titleurl from c表 c join e表 e on c.栏目id=e.栏目id union all
select e.栏目名,c.title,c.[time],c.titleurl from d表 d join e表 e on d.栏目id=e.栏目id ) t
order by [time] desc