times=(select max(times) from table)

解决方案 »

  1.   

    max本身就是分组函数,having 是分组条件,你这样使用就好比嵌套,死循环,当然包错一楼是正确用法
      

  2.   

    如果你想取出每一组中时间最大的如何取???比如那个字段是date类型的。????
      

  3.   

    select max(times),other_col 
      from table
     group by other_col不如你把你的sql贴出来好了,这样没头没脑地不好说
      

  4.   

    select cid,a,b,c from table1 where gid=123 and cid in (3,5,7,1,9) group by cid,times,a,b,c having times in (select max(oddstime) from table1 where gid=123 group by cid)
    我的问题解决了,我就是我的语句,做了一个子查询。Oracle太棒了,比Mysql强多了。
      

  5.   

    select max(oddstime)改为select max(times)