using a Oracle 10g db I have a table something like this:
create table x(
ID NUMBER(10) primary key,
wedding DATE NOT NULL
);
how can I
select * from x where wedding is in june 2008???
I know it is probably an easy one but I couldn’t find any satisfying answer so far.
Help is very much appreciated.
Use:
Use of
TO_DATEconstructs a date with a time portion of 00:00:00, which requires the end date to be one day ahead unless you want to use logic to correct the current date to be one second before midnight. Untested:That should add one day to 30-Jun-2008, and then subtract one second in order to return a final date of
30-Jun-2008 23:59.References: