write a query that displays every Friday in a year with date?

Answers were Sorted based on User's Feedback



write a query that displays every Friday in a year with date?..

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

write a query that displays every Friday in a year with date?..

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

write a query that displays every Friday in a year with date?..

Answer / colarif

select daten, to_char(daten,'DY') dayn from
( select to_date('31-dec-15') + level daten from dual
connect by level <= 366)
where to_char(daten,'DY') = 'FRI'
and to_char(daten,'YYYY') = 2016;

Is This Answer Correct ?    1 Yes 0 No

write a query that displays every Friday in a year with date?..

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

write a query that displays every Friday in a year with date?..

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

Post New Answer

More Oracle General Interview Questions

What are the composite date types in oracle?

6 Answers   HCL,


What are the attributes that are found in a cursor?

0 Answers  


How do we create privileges in oracle?

0 Answers  


How to convert a string to a date in oracle database?

0 Answers  


What is a package ? What are the advantages of package ?

0 Answers  






what is the difference between substr and instr function in oracle?

0 Answers  


what is Materialized view? What is a snapshot? what are the similarities and differences between Materialized views and snapshots?

2 Answers  


Hi can anyone tell me where are the dumps found of OCA certification.. Also the materials to be studied for the preparation.

2 Answers  


Define 'view' advantage ?

2 Answers   AZTEC, TCS,


Can u please explain me the Discussion on Except ,using cast like type cast. Question in the context of difference between two tables

0 Answers   Microsoft,


What is a Database instance ? Explain?

3 Answers  


How to drop an index in oracle?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)