select CustNo,min(时间) from table
group by CustNo

解决方案 »

  1.   

    select CustNo,Max(时间) as sj from 表 group by CustNo order by CustNo
      

  2.   

    select CustNo,min(时间) as 时间 from table
    group by CustNo
      

  3.   

    select * from yourtable A
    where 时间 = (select min(时间) from yourtable where CustNo = A.CustNo)
      

  4.   

    求最小应该是:
    select CustNo,Min(时间) as sj from 表 group by CustNo order by CustNo
      

  5.   

    取时间最小值就行了.
    select CustNo,min(时间) as 时间 from table
    group by CustNo
      

  6.   

    不需要用游标select CustNo,min(时间) from [Table] group by CustNo
      

  7.   

    select * from table a
    where  时间 = (select min( 时间 ) from table where CustNo =a.CustNo )
      

  8.   

    select * from table a
    where  时间 = (select min( 时间 ) from table where CustNo =a.CustNo )
      

  9.   

    select * from table a
    where  时间 = (select min( 时间 ) from table where CustNo =a.CustNo )
      

  10.   

    select CustNo,时间=min(时间) from 表名 group by CustNo
      

  11.   

    select * from 表 aa where 
    not exists(select 1 from 表 bb where aa.时间>bb.时间)
    or not exists(select 1 from 表 bb where aa.时间<bb.时间)
      

  12.   

    select CustNo,min(时间) as 最早时间 from 表名
    group by CustNo
      

  13.   

    这样就可以了。SELECT CustNo ,Min(时间) from 表名
    Group By CustNo
      

  14.   


    select * from yourtable A
    where 时间 = (select min(时间) from yourtable where CustNo = A.CustNo)被采用...因为group有太多限制了...呵..