abcd表中只有一条记录吗?那干嘛还要设那么多的表啊。

解决方案 »

  1.   


    -->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
      

  2.   


    -->楼上的逗号用的是中文的,这里纠正一下
    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