是不是oracle数据库?如果是:
把union后的表排序,取前十条记录就行了.
select * from T where rownum<=10
T就是union后排序的表

解决方案 »

  1.   

    就是不知怎么连接啊,怎么union????给个实例??
    thanks!!
      

  2.   

    select * from ta
    union 
    select * from tb
    union 
    select * from tc
    union 
    select * from td
    order by d_time
      

  3.   

    要前10条?
    select top 10 * from (
    select * from ta
    union 
    select * from tb
    union 
    select * from tc
    union 
    select * from td
    order by d_time)
      

  4.   

    create view tview as
    select c1,c2,d_time from ta
    union all
    select c1,c2,d_time from tb
    union all
    select c1,c2,d_time from tc
    union all
    select c1,c2,d_time from td
    union all
    select c1,c2,d_time from te;create view tsortview as
    select * from tview order by d_time;select * from tview where rownum<=10;
      

  5.   

    nononono是对的。呵呵,我就不用重复了吧。
      

  6.   

      如果仅是简单的查询,我同意nononono的,不过我觉得mycode建立视图的方法也对,不过我还是习惯用TOP来取前十条。
      

  7.   

    select top 10 * from (select * from ta union all
                          select * from tb union all 
                          select * from tc union all
                          select * from td 
                          order by d_time)