Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

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 added by Sameh Mohamed Aly Sewilam , Oracle Technical Team Leader , National Technology
Date Posted: 2014/08/21
Gaith Amer Yousef  Rammaha
by 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
by 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
by Mohammad Aman , Web Developer , IHCC

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

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.