SELECT A.A0,A.A1 FROM A WHERE A.A1=1;

解决方案 »

  1.   

    SELECT A0,MIN(A1) AS A1 FROM A
    GROUP BY A0
    ORDER BY A0
      

  2.   

    CSDNM(决定不当CSDN经理了) 的做法完全正确啊!
      

  3.   

    field   A0        A1           A2          A3                 
    value   0          x            a          h 
    0          2            b          i
    0          3            c          j
    1          y            d          k 
    1          2            e          l
    1          3            f          m 
    2          z            g          n
    Query Result
    A0             A1        A2          A3     
    0              x         a           h
    1              y         d           k
    2              z         g           n    
    就是A0相同的只取一个!和其他的字段没有关系,
      

  4.   

    select distinct A0 ,'' as A1 ,'' as A2,''as A3 
    into ##yTable from Aupdate ##yTable set A1=A.A1 ,A2=A.A2,A3=A.A3
    from A where ##yTable.A0=A.A0select * from ##yTabledrop table ##yTable
      

  5.   

    SELECT A0,A1, A2, A3 FROM A
    GROUP BY A0
    ORDER BY A0
      

  6.   

    dongquestion(dongdong)  的sql有问题,: hjhing(winding) 太麻烦廖
    有没有一句sql就可以
      

  7.   

    如果没有主键只能这样做select identity(int,1,1) as id,* into #tmp from yourtable 
    select a0,a1,a2,a3 from #tmp where id in (select max(id) from #tmp group by a0)
      

  8.   

    select * from myTable, (select  min(rowid) as id from myTable group by A0) c where myTable.rowid =id这样做有没有什么问题!
      

  9.   

    rowid唯一就没有问题select * from myTable, (select  min(rowid) as id from myTable group by A0) c where myTable.rowid =c.id
      

  10.   

    是的,如果2个表union,这时候的rowid,怎么求。
      

  11.   

    select distinct A0 ,'' as A1 ,'' as A2,''as A3 from a
      

  12.   

    给你个例子,其实把你的表结构弄上来就好解决了select min(x) from (select rowid as x ,rain.test_1.* from rain.test_1 union
    select rowid as x ,test.test.* from test.test) z group by z.a;