sql 질문입니다.
글쓴이: elwlwlwk / 작성시간: 목, 2013/07/11 - 3:40오후
select count(*)
from h_booking
where hb_ddate is not null
and to_char(hb_cdate, 'yyyymmdd') >= 20130711
and to_char(hb_sdate, 'yyyymmdd') <= '20130716' and to_char(hb_edate, 'yyyymmdd') > '20130716'
and (hb_rmode = 'C' or hb_rmode = 'S')
과
select nvl(sum(hr_rrcnt),0)
from h_rinfo
where to_char(hr_date,'YYYYMMDD') = '20130716'
and hr_rsize not in ('126', '99')
이것
첫번째 결과와 두번째 결과를 뺀 값을 한번에 가져오고 싶습니다. 어떻게 해야 하나요?
Forums:
그냥 빼면...
select (select count(*)... ) - (select nvl(....) from dual
댓글 달기