SQL Oracle Select all work days for this month.

Hello Experts Exchange
I want to be able to select each work day date for this month. Can someone provided the SQL I need please?

So for this month I would get from my select statement all the dates apart from the weekend dates.

For example.

WorkDay
---------------
03/08/2015
04/08/2015
05/08/2015
06/08/2015
07/08/2015
10/08/2015
11/08/2015
12/08/2015
13/08/2015
14/08/2015
17/08/2015
18/08/2015
19/08/2015
20/08/2015
21/08/2015
24/08/2015
25/08/2015
26/08/2015
27/08/2015
28/08/2015
31/08/2015

Regards

SQLSearcher
SQLSearcherAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sdstuberCommented:
SELECT *
    FROM (    SELECT TRUNC(SYSDATE, 'mm') + LEVEL - 1 workday
                FROM DUAL
          CONNECT BY TRUNC(SYSDATE, 'mm') + LEVEL - 1 <= LAST_DAY(SYSDATE))
   WHERE TO_CHAR(workday, 'Dy') NOT IN ('Sat', 'Sun')
ORDER BY workday

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SQLSearcherAuthor Commented:
Hello Sdstuber
Thank you that's just what I am looking for.

I understand most of the SQL, but I have never seen Connect By before, can you tell me what that line is doing please?

Regards

SQLSearcher
sdstuberCommented:
Normally connect by is used to create parent-child relationships in a hierarchical query.
In this case though it's being used a simple counter.
Effectively creating a hierarchy where 1 is parent of 2, 2 is parent of 3, and so on.

simplest example...

select level from dual connect by level < 10

you can use this technique to generate lots of data for a variety of purposes.
SQLSearcherAuthor Commented:
Brilliant! Thank you very much.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.