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 |
What are the logical operations?
What is the purpose of save points in oracle database?
What is a Sequence ?
How to do paging with oracle?
I have table-A(1,2,3,4,4,5,6,6,6,7). how to get all duplicate values?what is sql query?
how to genarate random numbers in oracle for particular row?
How is it different from a normal table?
How to use "in out" parameter properly?
What will be the syntax to find current date and time in format "yyyy-mm-dd"?
select * from emp what happened internally when we write this query in the sql prompt?
Which database is better for os platform dependency?
There are n numbers of flatfile of exactly same format are placed in a folder.Can we load these flatfile's data one by one to a single relational table by a single session??