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



i hv 30 rows with date.ex:1month hav 4 weeks i want 1st day of the every week.write the qry for that..

Answer / 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

More SQL PLSQL Interview Questions

What does fetching a cursor do?

0 Answers  


How do sql databases work?

0 Answers  


What is the basic structure of PL/SQL ?

6 Answers  


What is orm in sql?

0 Answers  


What is the function that is used to transfer a pl/sql table log to a database table?

0 Answers  






Is sql open source?

0 Answers  


How do you sort in sql?

0 Answers  


How do you create a unique index?

0 Answers  


What is not in sql?

0 Answers  


What is auto increment?

0 Answers  


How are multiple column = value pairs delimited in the SET clause of an UPDATE statement? 1. With commas (SET price = 0, status = 'I') 2. With parentheses (SET (price = 0) (status = 'I')) 3. With double-pipes (SET price = 0 || status = 'I') 4. With square-brackets (SET [price = 0] [status = 'I'] 5. With single or multiple spaces (SET price = 0 status = 'I')

2 Answers  


What is INSTEAD OF trigger ?

13 Answers   Hexaware, TCS,


Categories