select distinct a.* from x , y  where x.id=y.id

解决方案 »

  1.   

    select distinct a.* from x , y  where x.aa=y.aa and x.bb=y.bb
      

  2.   

    select *
    from X as t
    where not exists(select 1 from x where id = t.id and  AA < .taa)
      

  3.   

    我是想知道distinct  和 join 能不能可不可以在这里使用,怎么使用
      

  4.   

    1,看不出b表与数据结果有什么关系
    2,数据组果的取的以每个id为分组的第一条记录,自己插到临时表用identity列,或在sql2005中用row_number
      

  5.   


    数据好像没有必然的联系
    select top 1 * from X group  by X.ID