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 SAVE POINT ?

5 Answers  


what is difference between table and view? where to use views? thanks in advance!

1 Answers  


What is oracle in java?

0 Answers  


Is it possible to disable the parameter from while running the report ?

1 Answers   Honeywell, Oracle,


material view and view disadvantages?

0 Answers  






What is Database Link ?

2 Answers  


 What are the oracle DML commands possible through an update strategy?

0 Answers   Informatica,


i have a table with 1 lac of data.i want to insert this data into another table. i want every 5000 of data insert use a commit.using counter and if error is comming in the 5000 of data it rollback.

1 Answers   MasterCard,


Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?

0 Answers  


How do I escape a reserved word in oracle?

0 Answers  


What is the difference between I and G in Oracle?

0 Answers   MCN Solutions,


what is analyze command ? what kind of statistics does it generate?

2 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)