Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Write a query to display all days in the current year starting from 1-Jan to 31-Dec. The query should display 365 records for one column named Day

user-image
Question ajoutée par Sameh Mohamed Aly Sewilam , Oracle Technical Team Leader , National Technology
Date de publication: 2014/08/21
Gaith Amer Yousef  Rammaha
par Gaith Amer Yousef Rammaha , Sr. Oracle developer and Project Manager , Technology village information system TVIS

CREATE OR REPLACE PROCEDURE user.getday ISV_START_DATE date;V_END_DATE date;V_DAY varchar2(50);V_SUM_DATE number;begin select to_date('','dd-mm-yyyy') into V_Start_DATE From dual; select to_date('','dd-mm-yyyy') into V_END_DATE From dual; V_SUM_DATE := V_END_DATE - V_START_DATE +1; FOR i in1..V_SUM_DATE loopV_DAY := to_char(to_date(V_Start_DATE,'dd-mm-yyyy'),'DAY') ;insert into user.days(DAY) values(V_DAY);commit;V_START_DATE := V_START_DATE +1; END LOOP; end;

ADIL MUSTAFA
par ADIL MUSTAFA , Senior System Engineer , Infosys Limited

select to_char(to_date('1/1/','mm/dd/yyyy') + level -1,'DAY') from dual connect by level <=;

Mohammad Aman
par Mohammad Aman , Web Developer , IHCC

SELECT*FROM tablename WHERE columname BETWEEN':00:00'AND':59:59'easy!

More Questions Like This