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

What is the main reason behind using an index?

545


What is the default isolation level in sql server? : Transact sql

562


What is the use of function in sql?

529


How will you distinguish a global variable with a local variable in pl/sql?

618


How many commands are in sql?

521






What is the difference between sum and count in sql?

516


Explain the purpose of %type and %rowtype data types?

499


Is sqlite good enough for production?

527


What are the advantages of stored procedure?

535


Can function return multiple values in sql?

520


Is a view faster than a stored procedure?

542


What is cursor and its types?

550


What is mutating sql table?

602


Which join condition can be specified using on clause?

512


Which tcp/ip port does sql server run?

524