Променям малко заявката на Бен,
select count(distinct switch_id)
from [email protected]
where dealer_name = 'XXXX'
and creation_date between add_months(trunc(sysdate,'mm'),-1) and last_day(add_months(trunc(sysdate,'mm'),-1))
Променям малко заявката на Бен,
select count(distinct switch_id)
from [email protected]
where dealer_name = 'XXXX'
and creation_date between add_months(trunc(sysdate,'mm'),-1) and last_day(add_months(trunc(sysdate,'mm'),-1))