如果是时间,可以用TRUNC做日期截断,也可以to_char(时间, 'YYYYMMDD')把其转为字符串进行匹配。
------解决方案-------------------- 回帖就给分,何况此贴日后还有用
------解决方案-------------------- select sum(money) from ( select money from table where to_char(time,'yyyymmdd') = (select to_char(max(time),'yyyymmdd') from table) )
或者
select d,m from ( select t.*, rownum rn from ( select to_char(time,'yyyymmdd') d,sum(money) m from table group by to_char(time,'yyyymmdd') order by to_char(time,'yyyymmdd') desc ) t ) where rn <= 1
------解决方案--------------------