i hv 30 rows with date.ex:1month hav 4 weeks i want 1st day of the every week.write the qry for that.example jan has 4 weeks
i need 1st dd for evry wk

Answer Posted / kavitha singh

select year,week,date1,to_char(date1,'Day') day
from
(
select year, week,
next_day( to_date( '04-jan-' || year, 'dd-mon-yyyy' ) + (week-2)*7, 'mon' ) date1
from (select '2011' year, rownum week from all_objects where rownum <= 53 ))

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which tcp/ip port does sql server run on? How can it be changed? : Sql dba

481


What is the usage of distinct keyword?

617


what is sql? : Sql dba

549


what is a cursor? : Sql dba

546


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

659






What is dml statement?

507


How to get unique records from a table?

512


How to select 10 records from a table?

637


What is the purpose of the partition table?

537


How to write a query to show the details of a student from students table whose

533


What is rename in sql?

542


What is the difference between a primary key and a unique key?

548


What is trigger with example?

553


Is not null in sql?

551


What does bitemporal mean?

587