数据如下
c1                 c2                      c3
1-5QQHIY7 2 13331922414 2010-4-18 19:47:12
1-5OZ6CO4 2 13331922414 2010-4-18 19:10:29要求最小日期c1值,
结果
1-5OZ6CO4 2 13331922414

解决方案 »

  1.   

    with t as
    (select '1-5QQHIY7 2 13331922414 2010-4-18' c1 from dual union all
    select '1-5OZ6CO4 2 13331922414 2010-4-18' c2 from dual)
    select min(c1) from t
      

  2.   

    select t.* from tb t where c3 = (select min(c3) from tb where c2 = t.c2)
    select t.* from tb t where not exists (select 1 from tb where c2 = t.c2 and c3 < t.c3)
      

  3.   

    看似很简单的问题啊。select c1 from tb where rowno=1 order by c2 acs
    按照C2升序排序,然后去第一个值。
      

  4.   


    with t as
    (select '1-5QQHIY7 2 13331922414' c1 , '2010-4-18   19:47:12' c2 from dual union all
    select '1-5OZ6CO4 2 13331922414', '2010-4-18   19:10:29 ' c2 from dual)
    SELECT c1 FROM(
           SELECT c1, row_number() OVER(ORDER  BY c2) AS rn FROM t
           )
           WHERE rn = 1
      

  5.   

    select c1 from table where c2+c3 = (select min(c2+c3) from table)没有实测,大概这样吧 提供个思路