Skip to content
Advertisement

Oracle SQL conditional operator explanation

Please, may I ask if anyone can explain more on the following oracle sql conditional operator please ? I only have limited oracle sql knowledge that it exclude checking for Sat and sometime for Sunday. Thanks so much!

Advertisement

Answer

The decode is basically checking the day of the week and returns some magic number = 4, which seems to be some enumerator for status. Anyway, to add the Friday after 11 pm will be:

P.S. if your decode is 3 lines, you probably need to replace it with CASE. Case can do anything the DECODE can and is more readable.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement