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 composite date types in oracle?
What are the attributes that are found in a cursor?
How do we create privileges in oracle?
How to convert a string to a date in oracle database?
What is a package ? What are the advantages of package ?
what is the difference between substr and instr function in oracle?
what is Materialized view? What is a snapshot? what are the similarities and differences between Materialized views and snapshots?
Hi can anyone tell me where are the dumps found of OCA certification.. Also the materials to be studied for the preparation.
Define 'view' advantage ?
Can u please explain me the Discussion on Except ,using cast like type cast. Question in the context of difference between two tables
What is a Database instance ? Explain?
How to drop an index in oracle?