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 is rich query?

0 Answers  


Can an Integrity Constraint be enforced on a table if some existing table data does not satisfy the constraint ?

2 Answers  


Indexes in oracle ?

3 Answers   Keane India Ltd, L&T,


how to tune oracle sql queries pls tell me step by step. urgent pls

1 Answers  


Explain the characteristics of oracle dba?

0 Answers  






How to use values from other tables in update statements using oracle?

0 Answers  


How to use null as conditions in oracle?

0 Answers  


How to insert a record into a table?

0 Answers  


Is it possible to split the print reviewer into more than one region ?

0 Answers   Oracle,


What is oracle host variable?

0 Answers  


what's query optimization and without use of IN AND Exist can we get another way data from query

0 Answers  


There are three tables : E : EID,ENAME D : DID,DNAME empdept : eid, did select the employees who doesn't belong to any dep

4 Answers   Microsoft,


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)