Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
The provided dates from1/3/2014 to4/3/2014 the result should be like this:1/3/2014-2/3/2014-3/3/2014-4/3/2014
select to_date('01/03/2014', 'DD/MM/YYYY') + rownum -1 dt
from dual
connect by level <= to_date('04/03/2014', 'DD/MM/YYYY') - to_date('01/03/2014', 'DD/MM/YYYY') +1;
With parameters
select to_date(:from_date,'DD/MM/YYYY') + rownum -1 dt
from dual
connect by level <= to_date(:to_date,'DD/MM/YYYY') - to_date(:from_date,'DD/MM/YYYY') +1;
using
where datefield between @startDate and @endDate ...
DECLARE
@MinDate DATE = '',
@MaxDate DATE = '';
SELECT Date
FROM dbo.Calendar
WHERE Date >= @MinDate
AND Date < @MaxDate;
Select
to_date('01/03/2014','dd/mm/rrrr')+rnum-
1
from(selectrownum
rnum
from
all_objects
whererownum<=to_date('04/03/2014','dd/mm/rrrr')-
--END Date
to_date('01/03/2014','dd/mm/rrrr')+1)
--Start Date
select
A,
substr(SYS_CONNECT_BY_PATH(DATE, ','),2) DATE_list
from
(
select
DATE,
A,
count(*) OVER ( partition by A ) cnt,
ROW_NUMBER () OVER ( partition by A order by DATE) seq
from
TABLE
where
A is not null)
where
seq=cnt
start with
seq=1
connect by prior
seq+1=seq
and prior
A=A;
-----------
ALTERNATE OPTIONS
PIVOT TABLE FUNCTION
OR
CASE FUNCTIONS
CAN BE USED.