List all days of a month in single SQL

I want a single SQL which should output
01/Oct/2003
02/Oct/2003
30/Oct/2003
31/Oct/2003
Is that possible?

I did:
SQL> explain plan for
2 select trunc(sysdate,'Mon') + rownum -1 from all_objects
3 where rownum<=to_number(to_char(last_day(sysdate),'DD'));
Uitleg is gegeven.
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | | | |
|* 1 | COUNT STOPKEY | | | | |
|* 2 | FILTER | | | | |
| 3 | TABLE ACCESS BY INDEX ROWID| OBJ$ | | | |
| 4 | NESTED LOOPS | | | | |
| 5 | TABLE ACCESS FULL | USER$ | | | |
|* 6 | INDEX RANGE SCAN | I_OBJ2 | | | |
|* 7 | TABLE ACCESS BY INDEX ROWID| IND$ | | | |
|* 8 | INDEX UNIQUE SCAN | I_IND1 | | | |
|* 9 | TABLE ACCESS BY INDEX ROWID| OBJAUTH$ | | | |
| 10 | NESTED LOOPS | | | | |
| 11 | FIXED TABLE FULL | X$KZSRO | | | |
|* 12 | INDEX RANGE SCAN | I_OBJAUTH2 | | | |
|* 13 | FIXED TABLE FULL | X$KZSPR | | | |
|* 14 | FIXED TABLE FULL | X$KZSPR | | | |
|* 15 | FIXED TABLE FULL | X$KZSPR | | | |
|* 16 | FIXED TABLE FULL | X$KZSPR | | | |
|* 17 | FIXED TABLE FULL | X$KZSPR | | | |
|* 18 | FIXED TABLE FULL | X$KZSPR | | | |
|* 19 | FIXED TABLE FULL | X$KZSPR | | | |
|* 20 | FIXED TABLE FULL | X$KZSPR | | | |
|* 21 | FIXED TABLE FULL | X$KZSPR | | | |
|* 22 | FIXED TABLE FULL | X$KZSPR | | | |
|* 23 | FIXED TABLE FULL | X$KZSPR | | | |
|* 24 | FIXED TABLE FULL | X$KZSPR | | | |
|* 25 | FIXED TABLE FULL | X$KZSPR | | | |
|* 26 | FIXED TABLE FULL | X$KZSPR | | | |
|* 27 | FIXED TABLE FULL | X$KZSPR | | | |
|* 28 | FIXED TABLE FULL | X$KZSPR | | | |
|* 29 | FIXED TABLE FULL | X$KZSPR | | | |
Predicate Information (identified by operation id):
1 - filter(ROWNUM<=TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE@!),'DD')))
2 - filter(("SYS_ALIAS_2"."TYPE#"<>1 AND "SYS_ALIAS_2"."TYPE#"<>10 OR "
PLAN_TABLE_OUTPUT
SYS_ALIAS_2"."TYPE#"=1 AND (SELECT 1 FROM "SYS"."IND$" "I"
WHERE "I"."OBJ#"=:B1 AND ("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR
"I"."TYPE#"=3 OR "I"."TYPE#"=4 OR "I"."TYPE#"=6 OR "I"."TYPE
#"=7 OR "I"."TYPE#"=9))=1) AND ("SYS_ALIAS_2"."OWNER#"=:B2 O
R "SYS_ALIAS_2"."OWNER#"=1 OR "SYS_ALIAS_2"."TYPE#"<>11 AND
"SYS_ALIAS_2"."TYPE#"<>14 AND EXISTS (SELECT 0 FROM "SYS"."
OBJAUTH$" "OBJAUTH$","X$KZSRO" "X$KZSRO" WHERE "OBJAUTH$"."O
BJ#"=:B3 AND "OBJAUTH$"."GRANTEE#"="X$KZSRO"."KZSROROL" AND
("OBJAUTH$"."PRIVILEGE#"=3 OR "OBJAUTH$"."PRIVILEGE#"=6 OR "
OBJAUTH$"."PRIVILEGE#"=7 OR "OBJAUTH$"."PRIVILEGE#"=9 OR "OB
JAUTH$"."PRIVILEGE#"=10 OR "OBJAUTH$"."PRIVILEGE#"=12 OR "OB
JAUTH$"."PRIVILEGE#"=11 OR "OBJAUTH$"."PRIVILEGE#"=16 OR "OB
JAUTH$"."PRIVILEGE#"=17 OR "OBJAUTH$"."PRIVILEGE#"=18)) OR (
"SYS_ALIAS_2"."TYPE#"=7 OR "SYS_ALIAS_2"."TYPE#"=8 OR "SYS_A
LIAS_2"."TYPE#"=9 OR "SYS_ALIAS_2"."TYPE#"=28 OR "SYS_ALIAS_
2"."TYPE#"=29 OR "SYS_ALIAS_2"."TYPE#"=30 OR "SYS_ALIAS_2"."
TYPE#"=56) AND EXISTS (SELECT /*+ */ 0 FROM "X$KZSPR" "X$KZ
SPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B
4 AND ((-"X$KZSPR"."INDX")=(-144) OR (-"X$KZSPR"."INDX")=(-1
41))) OR "SYS_ALIAS_2"."TYPE#"=12 AND EXISTS (SELECT /*+ */
0 FROM "X$KZSPR" "X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND
"X$KZSPR"."INST_ID"=:B5 AND (-"X$KZSPR"."INDX")=(-152)) OR
"SYS_ALIAS_2"."TYPE#"=11 AND EXISTS (SELECT /*+ */ 0 FROM "
X$KZSPR" "X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR
"."INST_ID"=:B6 AND (-"X$KZSPR"."INDX")=(-141)) OR "SYS_ALIA
S_2"."TYPE#"=22 AND EXISTS (SELECT /*+ */ 0 FROM "X$KZSPR"
"X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_I
D"=:B7 AND ((-"X$KZSPR"."INDX")=(-189) OR (-"X$KZSPR"."INDX"
)=(-190) OR (-"X$KZSPR"."INDX")=(-191) OR (-"X$KZSPR"."INDX"
)=(-192))) OR ("SYS_ALIAS_2"."TYPE#"=1 OR "SYS_ALIAS_2"."TYP
E#"=2 OR "SYS_ALIAS_2"."TYPE#"=4 OR "SYS_ALIAS_2"."TYPE#"=5
OR "SYS_ALIAS_2"."TYPE#"=19 OR "SYS_ALIAS_2"."TYPE#"=20 OR "
SYS_ALIAS_2"."TYPE#"=34 OR "SYS_ALIAS_2"."TYPE#"=35) AND EX
ISTS (SELECT /*+ */ 0 FROM "X$KZSPR" "X$KZSPR" WHERE "X$KZSP
R"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B8 AND ((-"X$KZSPR"
."INDX")=(-45) OR (-"X$KZSPR"."INDX")=(-47) OR (-"X$KZSPR"."
INDX")=(-48) OR (-"X$KZSPR"."INDX")=(-49) OR (-"X$KZSPR"."IN
DX")=(-50))) OR "SYS_ALIAS_2"."TYPE#"=6 AND EXISTS (SELECT
/*+ */ 0 FROM "X$KZSPR" "X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"
=1 AND "X$KZSPR"."INST_ID"=:B9 AND (-"X$KZSPR"."INDX")=(-109
)) OR "SYS_ALIAS_2"."TYPE#"=13 AND EXISTS (SELECT /*+ */ 0
PLAN_TABLE_OUTPUT
FROM "X$KZSPR" "X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND "X
$KZSPR"."INST_ID"=:B10 AND ((-"X$KZSPR"."INDX")=(-184) OR (-
"X$KZSPR"."INDX")=(-181))) OR "SYS_ALIAS_2"."TYPE#"=14 AND
EXISTS (SELECT /*+ */ 0 FROM "X$KZSPR" "X$KZSPR" WHERE "X$KZ
SPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B11 AND (-"X$KZSP
R"."INDX")=(-181)) OR "SYS_ALIAS_2"."TYPE#"=23 AND EXISTS (
SELECT /*+ */ 0 FROM "X$KZSPR" "X$KZSPR" WHERE "X$KZSPR"."KZ
SPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B12 AND ((-"X$KZSPR"."IND
X")=(-177) OR (-"X$KZSPR"."INDX")=(-178))) OR "SYS_ALIAS_2".
"TYPE#"=42 AND EXISTS (SELECT /*+ */ 0 FROM "X$KZSPR" "X$KZ
SPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B
13 AND ((-"X$KZSPR"."INDX")=(-45) OR (-"X$KZSPR"."INDX")=(-4
7) OR (-"X$KZSPR"."INDX")=(-48) OR (-"X$KZSPR"."INDX")=(-49)
OR (-"X$KZSPR"."INDX")=(-50))) OR "SYS_ALIAS_2"."TYPE#"=32
AND EXISTS (SELECT /*+ */ 0 FROM "X$KZSPR" "X$KZSPR" WHERE
"X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B14 AND ((-"
X$KZSPR"."INDX")=(-205) OR (-"X$KZSPR"."INDX")=(-206) OR (-"
X$KZSPR"."INDX")=(-207) OR (-"X$KZSPR"."INDX")=(-208))) OR "
SYS_ALIAS_2"."TYPE#"=33 AND EXISTS (SELECT /*+ */ 0 FROM "X
$KZSPR" "X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"
."INST_ID"=:B15 AND ((-"X$KZSPR"."INDX")=(-200) OR (-"X$KZSP
R"."INDX")=(-201) OR (-"X$KZSPR"."INDX")=(-202) OR (-"X$KZSP
R"."INDX")=(-203) OR (-"X$KZSPR"."INDX")=(-204))) OR "SYS_AL
IAS_2"."TYPE#"=44 AND EXISTS (SELECT /*+ */ 0 FROM "X$KZSPR
" "X$KZSPR" WHERE "X$KZSPR"."KZSPRPRV"=)
6 - access("SYS_ALIAS_2"."OWNER#"="U"."USER#" AND "SYS_ALIAS_2"."LINKNA
ME" IS NULL)
filter("SYS_ALIAS_2"."LINKNAME" IS NULL AND "SYS_ALIAS_2"."NAME"<>'
defaultauditing_options_' AND "SYS_ALIAS_2"."NAME"<>'_NEXT
_OBJECT')
7 - filter("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE
#"=4 OR "I"."TYPE#"=6 OR "I"."TYPE#"=7 OR "I"."TYPE#"=9)
8 - access("I"."OBJ#"=:B1)
9 - filter("OBJAUTH$"."PRIVILEGE#"=3 OR "OBJAUTH$"."PRIVILEGE#"=6 OR "O
BJAUTH$"."PRIVILEGE#"=7 OR "OBJAUTH$"."PRIVILEGE#"=9 OR "OBJ
AUTH$"."PRIVILEGE#"=10 OR "OBJAUTH$"."PRIVILEGE#"=12 OR "OBJ
AUTH$"."PRIVILEGE#"=11 OR "OBJAUTH$"."PRIVILEGE#"=16 OR "OBJ
AUTH$"."PRIVILEGE#"=17 OR "OBJAUTH$"."PRIVILEGE#"=18)
12 - access("OBJAUTH$"."GRANTEE#"="X$KZSRO"."KZSROROL" AND "OBJAUTH$"."O
BJ#"=:B1)
13 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
PLAN_TABLE_OUTPUT
$KZSPR"."INDX")=(-144) OR (-"X$KZSPR"."INDX")=(-141)))
14 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND (-"X$
KZSPR"."INDX")=(-152))
15 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND (-"X$
KZSPR"."INDX")=(-141))
16 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-189) OR (-"X$KZSPR"."INDX")=(-190) OR (-"X
$KZSPR"."INDX")=(-191) OR (-"X$KZSPR"."INDX")=(-192)))
17 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-45) OR (-"X$KZSPR"."INDX")=(-47) OR (-"X$K
ZSPR"."INDX")=(-48) OR (-"X$KZSPR"."INDX")=(-49) OR (-"X$KZS
PR"."INDX")=(-50)))
18 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND (-"X$
KZSPR"."INDX")=(-109))
19 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-184) OR (-"X$KZSPR"."INDX")=(-181)))
20 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND (-"X$
KZSPR"."INDX")=(-181))
21 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-177) OR (-"X$KZSPR"."INDX")=(-178)))
22 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-45) OR (-"X$KZSPR"."INDX")=(-47) OR (-"X$K
ZSPR"."INDX")=(-48) OR (-"X$KZSPR"."INDX")=(-49) OR (-"X$KZS
PR"."INDX")=(-50)))
23 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-205) OR (-"X$KZSPR"."INDX")=(-206) OR (-"X
$KZSPR"."INDX")=(-207) OR (-"X$KZSPR"."INDX")=(-208)))
24 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-200) OR (-"X$KZSPR"."INDX")=(-201) OR (-"X
$KZSPR"."INDX")=(-202) OR (-"X$KZSPR"."INDX")=(-203) OR (-"X
$KZSPR"."INDX")=(-204)))
25 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-222) OR (-"X$KZSPR"."INDX")=(-223)))
26 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND (-"X$
KZSPR"."INDX")=12)
27 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-251) OR (-"X$KZSPR"."INDX")=(-252) OR (-"X
$KZSPR"."INDX")=(-253) OR (-"X$KZSPR"."INDX")=(-254)))
28 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-65) OR (-"X$KZSPR"."INDX")=(-66) OR (-"X$K
ZSPR"."INDX")=(-67) OR (-"X$KZSPR"."INDX")=(-68)))
PLAN_TABLE_OUTPUT
29 - filter("X$KZSPR"."KZSPRPRV"=1 AND "X$KZSPR"."INST_ID"=:B1 AND ((-"X
$KZSPR"."INDX")=(-246) OR (-"X$KZSPR"."INDX")=(-247) OR (-"X
$KZSPR"."INDX")=(-248) OR (-"X$KZSPR"."INDX")=(-249)))
Note: rule based optimization
169 rijen zijn geselecteerd.
SQL>

Similar Messages

  • ICal multi-day (not all day) event  in Month view not displayed over days

    What is it when I have an event that starts on a Wednesday and 4:00pm and goes to Friday at 6:00pm (not clicked as an All Day Event), (in Month view) the only day showing the event is the first day?! Shouldn't it show it over the course of the 3 days!? Outlook does that (I can't believe I just referenced Outlook in an Apple Discussion... in a positive light no less). Is it a setting?

    Yes, Apple any help for this would be great. The only way I've come to work around is to use multiple events. So for a flight out of town would be one event, and the return another. I would create a third event then for the actual time out of town. There must be some way to easily fix this.

  • How can i load data from access database to datagridview with custom columns all days of a month ?

    Hi guys
    I am newbie in vb net and I want your help to solve a problem.
    I have this datagridview with two columns and all days of a month in custom columns.
    [IMG]http://i59.tinypic.com/2qwpj15.png[/IMG]
    I also have one combobox to change Year and a combobox to change Month.
    Here is the code to load data
    Private Sub fill_plan()
    dgMonth.Rows.Clear()
    Try
    Dim i As Integer = 0
    Dim query As String = "SELECT MonID,Unitname,Personel,Udate FROM tblMonth ORDER BY Unitname"
    con.Open()
    cmd = New OleDbCommand(query, con)
    myDR = cmd.ExecuteReader
    If myDR.HasRows Then
    While myDR.Read
    dgMonth.Rows.Add()
    dgMonth.Rows(i).Cells(0).Value = myDR.GetInt32(myDR.GetOrdinal("MonID"))
    dgMonth.Rows(i).Cells(1).Value = myDR.GetString(myDR.GetOrdinal("Unitname"))
    dgMonth.Rows(i).Cells(2).Value = myDR.GetInt32(myDR.GetOrdinal("Personel"))
    i = i + 1
    End While
    End If
    myDR.Close() : con.Close()
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub
    With
    this code the
    personel column
    loads the first
    day of the month.
    I want to load
    the column the date that is
    in the database.

    Hello,
    This can be done with less code
    Private Sub fill_plan()
    dgMonth.DataSource = Nothing
    Dim dt As New DataTable
    Try
    Dim query As String = "SELECT MonID,Unitname,Personel,Udate FROM tblMonth ORDER BY Unitname"
    con.Open()
    cmd = New OleDbCommand(query, con)
    dt.Load(cmd.ExecuteReader)
    dgMonth.DataSource = dt
    Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
    End Try
    End Sub
    The above loads all rows, if you want to limit the rows placed in the DataGridView this is best done in the SQL via WHERE conditions and/or with SELECT TOP x.
    Formatting of the data is best done via the property window for the DataGridView on whatever column you want too. Using the above you now need to set the data property for each column and set dgMonth.AutoGenerateColumns = False, in the end we end up with
    less code
    edit is there a reason for returning the primary key? If so then using my method we can hide that field but I see no reason for having it in this case
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • HT202337 list all-day events in day view on Mac icalendar with Yosemite upgrade

    Before I upgraded to Yosemite, I loved that the day view of the iCalendar on the Mac showed all the calendar events (including all-day events) in a list view. Now that I have upgraded, the day view shows in the same format as week view with timed events primarily displayed and all-day events at the top in a small section with a scroll bar.  I use all-day events a lot, and would much prefer the list of events (including all-day events) when looking at the day view!  (It is this way on the iPhone, but no longer on the Mac icalendar.)  How can I get back to this listed events in the day view?? Or if not, is there a way to move down the bar underneath the all-day events section (to show more of the all-day events at a time)? PLEASE? Help??  Thank you in advance!!

    Carriebrandon03,
    To Repair Disk Permissions, Home Folder Permissions and ACLs in Recovery Mode. Do the Following:
    Shutdown your Mac > on reboot hold down the ( Command ) and ( R ) keys.
    If prompted > Select the best language suited for you and tap the Arrow in the bottom middle >
    On the "OS X Utilities" Window that comes up select Disk Utility and press the Continue Button > Select the indented Hard Drive mine is Macintosh HD > If you have FileVault enabled you may have to unlock the drive, I don't so I'm not 100% sure > Click the "Repair Disk" button, wait until you see "The Volume Macintosh HD appears to be OK" It will be green > Click the "Repair Disk Permissions" button wait until you see "Permissions repair complete" > Hit the Red X top left corner to close Disk Utility. > You will see the "OS X Utilities" Window again.
    Select Utilities ( Menubar ) > Terminal > In Terminal type:
    resetpassword
    The "Reset Password" Window will open behind Terminal > Select your Hard Drive mine is Macintosh HD > On the drop down select your User's name > Click the "Reset" button bottom right > repeat for each user.
    Select  ( Menubar ) > Shutdown
    Screenshots Included below to help guide. Sorry about the quality of some of the shots as I had to take the photos of my screen.
    Hope that helps,
    Weston

  • Showing more All-Day Events in Month View?

    Even with the iCal window maximized, when more than 4 All-Day events take place on the same day, Month View shows "..." instead of the usual All-Day colour bar, even if there's still half the space left in 'box' for that day....
    To be clear: it shows the first 4 colour bars for the corresponding all-day events, then "..." at the top to show there are more, you have to switch to Week or Day view to see them
    I looked at the plist and can't figure what could be changed.... any tips? It would really be convenient to see the maximum possible number of All-Day events even in Month view.
    Merci!
    François
    iBook G4   Mac OS X (10.4.5)  

    Unfortunately, it appears that this is intentional. The iCal Help file states:
    "If you're in Month view and you see three dots (an ellipsis) at the top of the day, there is not enough room to show all the events on that day. To see all the events in Day view, double-click the ellipsis."
    I suspect that half of the box is saved for all-day events and half for timed events. On my iMac G3, I get three dots and 3 events, on my G5 with a much larger screen I get three dots and 4 events. If anyone figures out how to alot more space to all-day events, it would be a big help.

  • All-Day Events in Month View

    When I have more than two all-day events (Just one day) that are in different categories in one day, only two show. The others are hidden and you have to open the week or day calendar to view them. When the events are regular events there is not a problem, but I would like to know how to be able to view three all-day events or more from the month view. Is this even possible?

    Same problem here; if I EVER find out the solution I will post it here.

  • Variable to show ALL days of the month

    I have a data provider that looks like this:
    OID Name Occurence
    1 Lemons 20/10/2009
    2 Apples 21/10/2009
    3 Pearss 24/10/2009
    4 Lemons 20/10/2009
    5 Apples 21/10/2009
    I want produce a cross tab that INCLUDES the count for each day of the month even if an occurence has not happened on that date:
    Date 01/10 through to 30/10
    Lemons
    Apples
    Pears
    er how do I do this?

    Joe,
    Insert an extra dataprovider for all the days in the month with a dummy value. You can then add that dummy value in your
    crosstab and hide it.
    Cheers,
    Harry
    PS,
    Please post your mesage only once instead of 2 or 3 times.

  • List of day in a month

    Hi,
    I want to create a dynamic query that display the hours of each day in the current month in this format.
    For example dd/mm/yyyy hh24:mi:ss
    01/02/2010 01:00:00
    01/02/2010 02:00:00
    01/02/2010 03:00:00
    02/02/2010 01:00:00
    02/02/2010 02:00:00
    02/02/2010 03:00:00
    [...]from the first day to the last day in current month.
    Some idea?
    Thanks to all, as usual
    Cheers,
    Lain

    SQL> select trunc(sysdate,'MM')+(level-1)/24 time
      2  from dual
      3  connect by level <= to_char(last_day(sysdate),'dd')*24;
    TIME
    01/02/2010 00:00:00
    01/02/2010 01:00:00
    01/02/2010 02:00:00
    01/02/2010 03:00:00
    01/02/2010 04:00:00
    01/02/2010 05:00:00
    01/02/2010 06:00:00
    01/02/2010 07:00:00
    01/02/2010 08:00:00
    01/02/2010 09:00:00
    01/02/2010 10:00:00
    28/02/2010 18:00:00
    28/02/2010 19:00:00
    28/02/2010 20:00:00
    28/02/2010 21:00:00
    28/02/2010 22:00:00
    28/02/2010 23:00:00
    672 rows selected.Max
    [My Italian Oracle blog| http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • Show all days in a  month select

    hello
    i have a ckeckin - checkout table as
    id number pk,
    emp_id number fk,
    checkin date , -- user date enters
    checkout date -- user logsout
    totalhours number ,
    totalminutes number,
    state varchar2(3) default 'in'
    it keeps totalhours and mins of an employer .i need
    a select based on that table of one month
    but i want to see the days in the month
    (if a user did not enter one day iwant to see o hours , 0 minutes )
    select totalhours , totalminutes , checkindate
    from checkin_table
    where to_char(checkindate,'mon')='FEB'
    and emp_id='2'
    order by checkindate
    and i need something like
    7,59, 1-feb
    0,0,2-feb
    0,0,3feb
    8,04,4-feb
    best regards
    Aris dc
    and

    What I like in that case is the pipelined function. You can see an example usage Re: Can a view be created within the BEGIN and END block of a procedure
    Nicolas.

  • Using all days in a month

    Hi, how I make to use all days in a select that has only a few days.
    e.g.: in a select return 5 days (01-02-08, 01-04-08, 01-12-08, 01-21-08, 01-25-08) but i need all days 01-01-08 .. 01-31-08 as a table.
    Days..........Production
    01-01-08....0
    01-02-08....150
    01-03-08....0
    01-04-08....201
    01-05-08....0
    01-06-08....0
    01-07-08....0
    01-08-08....0
    01-09-08....0
    01-10-08....0
    01-31-08....0
    Edited by: user622983 on 28/01/2009 02:44
    Edited by: user622983 on 28/01/2009 02:45

    SELECT   v.newdt, NVL (z.production, 0)
        FROM (WITH d AS
                   (SELECT   TRUNC (TO_DATE ('jan-2009', 'MON-YYYY'), 'MM')
                           - 1 AS dt
                      FROM DUAL)
              SELECT     dt + LEVEL newdt
                    FROM d
              CONNECT BY LEVEL <= ADD_MONTHS (dt, 1) - dt) v,
             (SELECT *
                FROM (WITH t AS
                           (SELECT TO_DATE ('01-jan-2009', 'dd-mon-yyyy') dt,
                                   10 production
                              FROM DUAL
                            UNION
                            SELECT TO_DATE ('05-jan-2009', 'dd-mon-yyyy') dt,
                                   20 production
                              FROM DUAL)
                      SELECT *
                        FROM t)) z
       WHERE v.newdt = z.dt(+)
    ORDER BY 1;

  • How to select all days in a month

    I want to select all the days from 1 to the end of the monht of a month.
    Something like
    select day
    From dual
    where month = 'oct-2005'
    This should give 31 records from 1-oct-2005 till 31-oct-2005 ...
    Has anyone a good idea ?

    SELECT   ename, dat
        FROM emp,
             (SELECT     TRUNC (SYSDATE, 'MM') + LEVEL - 1 dat
                    FROM DUAL
              CONNECT BY TRUNC (SYSDATE, 'MM') + LEVEL - 1 <
                                               LAST_DAY (TRUNC (SYSDATE, 'MM'))
                                               + 1)
    ORDER BY ename, datfor more SQL problems & questions, please visit
    http://cafe.daum.net/oraclesqltuning

  • Function to retrieve all days of the previous month.

    Hi,
    Yes, it's a monthly report i've been given the task to achieve.
    So, all I need is all days of previous month (even if there is no data for this day)
    I've been instructed to use the following code, but it does not return any value:
    DECLARE
       CURSOR CUR_LAST_DAY IS
          SELECT TO_CHAR (LAST_DAY (ADD_MONTHS (SYSDATE, -1) ), 'DD')
            FROM DUAL;
       VVA_LAST_DAY   VARCHAR2 (2);
       VNU_JOUR       NUMBER       := 0;
    BEGIN
       OPEN CUR_LAST_DAY;
       FETCH CUR_LAST_DAY
        INTO VVA_LAST_DAY;
       CLOSE CUR_LAST_DAY;
       WHILE VNU_JOUR <= TO_NUMBER (VVA_LAST_DAY) - 1
       LOOP
          VNU_JOUR := VNU_JOUR + 1;
       END LOOP;
    END;
    --CLOSE CUR_LAST_DAY
    --DEALLOCATE CUR_LAST_DAY-----
    On the other end, i've developped this code:
    SELECT TO_CHAR(SYSDATE,'dd')
    FROM DUAL
    WHERE TO_CHAR(SYSDATE,'dd') >= to_char(to_date(to_char(ADD_MONTHS(SYSDATE, -1),'yyyy-mm')||'-01'),'yyyy-mm-dd')
    AND TO_CHAR(SYSDATE,'dd') < to_char(LAST_DAY(to_date(to_date(to_char(ADD_MONTHS(SYSDATE, -1),'yyyy-mm')||'-01'),'yyyy-mm-dd')));Which is returning a null value. :(
    Regards

    Hello,
    You want to retrieve complete days of last month from one query...so here it is..
    SELECT
    TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY') COMP_DATE,
    TO_CHAR(TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY'),'DD') ONLY_DD,
    TO_CHAR(TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY'),'MM') ONLY_MM,
    TO_CHAR(TO_DATE(LEVEL||'-'||TO_CHAR(ADD_MONTHS(SYSDATE,-1),'MON-YY'),'DD-MON-YY'),'YY') ONLY_YY
    FROM DUAL
    CONNECT BY LEVEL <= TO_NUMBER(TO_CHAR(LAST_DAY(ADD_MONTHS(SYSDATE,-1)),'DD'))I am not at database machine so therefore not tested.
    But one thing keep in mind that this forum only for reports there is separate forum for sql and pl/sql.
    Function to retrieve all days of the previous month.
    -Ammad
    Edited by: Ammad Ahmed on Apr 22, 2010 10:53 PM
    Spelling Mistake

  • Schedule Executed weekly except for a specific day of the month

    Hi all,
    I need to create a schedule that run weekly every sunday at 9 PM, except for 2nd day of the month it will run at 7 AM.
    I have created 2 schedules:
    1. One to run weekly every sunday at 9 PM, but i don't know from where i can specify the days of the month the schedule will be inactive on it.
    * I have tried By Month Day option, and choose all days of the month except second day of the month to run on it.
    FREQ=WEEKLY; BYMONTHDAY=1,3,4,5,..,31; BYDAY= SUN; BYHOUR=21;
    But, on the schedule preview window as i have designed the schedule from oracle warehouse builder, shows sunday, 02, July for example.
    as an execution date for this schedule.
    which is not appropriate.
    2. Another job is created to run monthly on the 2nd day of the month,
    FREQ=MONTHLY; BYMONTHDAY=2; BYDAY= SUN; BYHOUR=7;
    So, please advice how to create schedules daily or weekly and neglect some days of month from it.

    Hi,
    You can use the exclude clause introduced in 10gR2 for this by creating a schedule when your job should not run and excluding it. An example is given below.
    Hope this helps,
    Ravi.
    create or replace procedure print_schedule_dates
       schedule in varchar2,
       start_date in timestamp with time zone default dbms_scheduler.stime(),
       number_of_dates in pls_integer default 10
    is
      date_after timestamp with time zone := start_date - interval '1' second;
      next_date timestamp with time zone;
    begin
      for i in 1 .. number_of_dates
      loop
        dbms_scheduler.evaluate_calendar_string
         (schedule, start_date, date_after, next_date);
        dbms_output.put_line(to_char(next_date,
                        'DY DD-MON-YYYY (DDD-IW) HH24:MI:SS TZH:TZM TZR'));
        date_after := next_date;
      end loop;
    end;
    begin
      dbms_scheduler.create_schedule('monthday2',
        repeat_interval=>'freq=monthly;bymonthday=2');
    end;
    exec print_schedule_dates('FREQ=WEEKLY;BYDAY=SUN;BYHOUR=21;exclude=monthday2',sysdate+1,30);
    exec print_schedule_dates('FREQ=WEEKLY;BYDAY=SUN;BYHOUR=21',sysdate+1,30);

  • Wrap text for all-day events

    I've seen this question floating around, unanswered, since 2005...
    How can I get iCal to show the full text of an all-day event in Month View? There's lots of blank white space, but it seems that iCal never wraps the text of all-day events, and just cuts off the text that doesn't fit on one line.
    Am I missing something? Is there any way to get Apple to implement something so basic?

    I have the same question, but need to add one odd observation about my own experience...
    When I enter new events, sometimes the text wraps to two lines and sometimes the text is cut off after one line. It appears to be about 50-50. I can find no explanation for this behavior anywhere nor any way to control it. Very strange.

  • 3 Dots in Corner Of Day Box in Month View

    When in the month view of iCal several days of every month have 3 periods/dots in the upper left hand corner of the day box that can't be deleted. Ever see this and can they be erased.
    Thanks

    My problem is related, and I would like to display these. Is there an override? There seems to be at least 1/2 of each daily box empty.
    ical: show all-day events on monthly view?
    I use iCal to track rentals in a couple of vacation apartments I manage. I have separate calendars for each, and more for personal items, etc., and a typical event would cover 7 days as an all-day event. When I checkmark 4 calendars, only 3 events will show up in the monthly view, the other(s) being designated as 3 dashes instead of the info (---). Is there a way to override this so I can quickly see what is booked for an entire month? Switching back and forth to weekly view doesn't cut it, when I need to answer availability questions quickly.

Maybe you are looking for

  • ICloud with Windows 7 and Outlook 2013

    I have Icloud and Outlook 2013 working with Windows 8 but I cant get it to sync contacts and calendars on Windows 7. I keep getting a message about no default profile  in Outlook. Can anyone help please? Regards, Roger

  • How to do autofit selection in the GUI_DOWNLOAD

    hi, I am working on reports, i need to download to a .csv file. I am using GUI_DOWNLOAD is there any option for it where text fits exactly in a single cell. For Eg: I excel there is an option (Format-column-Autofitselection). Then the column size inc

  • Blackberry z10 - no messages in business hub

    Hello Community, I just received my blackberry Z10 phone and I have to say it is very very nice to use. It´s working threw our company server, and I use the company e-mail on it. The only big issue I have is that if I´m in the business hub, I do not

  • Never ending search

    Just today, when I search in Spotlight or in the Finder it never stops, just keeps spinning. Can the HD lose it's index? Can I force a re-indexing? I'm using a MDD G4.

  • Monitor network use

    I have set up a snow leopard server at a small publisher's. There are Macs of many shapes and sizes. Traditionally, there have been no restrictions as to use of the machines, and we do not wish to impose strict guidelines. On the other hand, resource