This answer is similar to Nicholas, which is not surprising, because you need a subquery with CONNECT BY to cross out the list of dates. Then the dates can be recounted by checking the day of the week. The difference here is that it shows how to get the value of the day of the week count in each row of results:
SELECT FromDate, ThruDate, (SELECT COUNT(*) FROM DUAL WHERE TO_CHAR(FromDate + LEVEL - 1, 'DY') NOT IN ('SAT', 'SUN') CONNECT BY LEVEL <= ThruDate - FromDate + 1 ) AS Weekday_Count FROM myTable
The invoice is turned on, i.e. includes FromDate and ThruDate . This query assumes that your dates do not have a time component; if they do, you will need the TRUNC date columns in the subquery.
source share