write a query that displays every Friday in a year with date?
Answers were Sorted based on User's Feedback
Answer / ranjan
SELECT C_DATE, TO_CHAR(C_DATE,'DY')
FROM
(
SELECT TO_DATE('01-JAN-2016','DD-MON-YYYY')+LEVEL-1 C_DATE
FROM DUAL
CONNECT BY LEVEL <= (SYSDATE - TO_DATE('01-JAN-2016','DD-MON-YYYY')+1)
)
WHERE TO_CHAR(C_DATE,'DY') = 'FRI'
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / basanti meher
SELECT A_DATE, TO_CHAR(A_DATE,'DY')
FROM
(
SELECT TO_DATE('01-JAN-2016','DD-MON-YYYY')+LEVEL-1 A_DATE
FROM DUAL
CONNECT BY LEVEL <= (366)
)
WHERE TO_CHAR(A_DATE,'DY') = 'FRI'
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sivareddy
SELECT C_DATE, TO_CHAR(C_DATE,'DY')
FROM
(
SELECT TO_DATE('01-JAN-2016','DD-MON-YYYY')+LEVEL-1 C_DATE
FROM DUAL
CONNECT BY LEVEL <= to_date('31-dec-2016','dd-mon-yyyy') - TO_DATE('01-JAN-2016','DD-MON-YYYY')+1)
WHERE TO_CHAR(C_DATE,'DY') = 'FRI'
/
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / anish
select distinct next_day((sysdate-level),'FRI') as fir from dual
connect by level <=(sysdate-to_date('01-Jan-2017','dd-mon-yyyy'))
order by 1 asc
Is This Answer Correct ? | 0 Yes | 1 No |
Can any one explain me when i execute below query.. select months_between('07-JUL-12','10-FEB-12') from dual; Out put:- 4.90322581 How oracle calculate?
How can we Update a table with out using UPDATE command?
What is Data Block ?
Can we create database in oracle using command line ?
How to use "while" statements in oracle?
is there a tool to trace queries, like profiler for sql server?
What is rowid and rownum in oracle?
How to execute a stored procedure in oracle?
if you update view? where we store the data?
Explain integrity constraint?
Can we write insert statement in function in oracle?
What are the attributes of cursor?