select   TN_PROCESS_ROUTE.*   from     TN_PROCESS_ROUTES,TN_PROCESS_ROUTE     where   TN_PROCESS_ROUTES.OBJECT_ID   =   TN_PROCESS_ROUTE.OBJECT_ID   

解决方案 »

  1.   

    select a.*,b.* from TN_PROCESS_ROUTES,
    (select t.* from TN_PROCESS_ROUTE t where id = (select max(id) from TN_PROCESS_ROUTE where [OBJECT_ID] = t.OBJECT_ID)) b
    where  a.[OBJECT_ID] = b.[OBJECT_ID]   
      

  2.   

    create table #t1 (id int ,nnn1 int)
    insert #t1 select 1,2
    union all select 2,2
    union all select 3,2
    union all select 4,2
    create table #t2 (id int ,nnn2 int)
    insert #t2 select 1,3
    union all select 2,3
    union all select 3,3
    union all select 4,3
    select a.*,b.nnn2 from #t1 a join #t2 b on a.id= b.iddrop table #t1
    drop table #t2