日期:2014-05-17 浏览次数:20585 次
with newVal(val_type,val_price) as
  (select rp.roomtypeid, sum(rp.price)
  from room_price rp
  where rp.hotelno=1 and rp.thisdate between to_date('2012-07-30','yyyy-mm-dd') and to_date('2012-08-02','yyyy-mm-dd')
  group by rp.roomtypeid)
select room_type.roomtypename, val_price
from newVal, room_type
where room_type.roomtypeid = newVal.val_type