Skip to main content
adicionou 3 caracteres ao conteúdo
Fonte Link
Rafael Tavares
  • 5,2mil
  • 11
  • 31
  • 52

To show the lastPara mostrar os últimos 30 days just rundias, use:

select 
    to_date(to_char(sysdate-30,'dd/mm/yyyy'), 'dd/mm/yyyy') + rownum -1 AS data
from 
    all_objects
where 
    rownum <= to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy') - to_date(to_char(sysdate-30,'dd/mm/yyyy'),'dd/mm/yyyy')+1;

To show the last 30 days just run:

select 
    to_date(to_char(sysdate-30,'dd/mm/yyyy'), 'dd/mm/yyyy') + rownum -1 AS data
from 
    all_objects
where 
    rownum <= to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy') - to_date(to_char(sysdate-30,'dd/mm/yyyy'),'dd/mm/yyyy')+1;

Para mostrar os últimos 30 dias, use:

select 
    to_date(to_char(sysdate-30,'dd/mm/yyyy'), 'dd/mm/yyyy') + rownum -1 AS data
from 
    all_objects
where 
    rownum <= to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy') - to_date(to_char(sysdate-30,'dd/mm/yyyy'),'dd/mm/yyyy')+1;
Fonte Link

To show the last 30 days just run:

select 
    to_date(to_char(sysdate-30,'dd/mm/yyyy'), 'dd/mm/yyyy') + rownum -1 AS data
from 
    all_objects
where 
    rownum <= to_date(to_char(sysdate,'dd/mm/yyyy'),'dd/mm/yyyy') - to_date(to_char(sysdate-30,'dd/mm/yyyy'),'dd/mm/yyyy')+1;