Link to home
Start Free TrialLog in
Avatar of SQLSearcher
SQLSearcher

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SQLSearcher
SQLSearcher

ASKER

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
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.
Brilliant! Thank you very much.