MP3JOSS

SQL: DECODE Vs. CASE Statement

SQL: DECODE Vs. CASE Statement

Choose Download Format

Download MP3 Download MP4

Details

TitleSQL: DECODE Vs. CASE Statement
AuthorGoLearningPoint
Duration7:06
File FormatMP3 / MP4
Original URL https://youtube.com/watch?v=VNSUmYJJqU4

Description

**DECODE Vs. CASE
Decode is a Function and CASE is a statement.
Decode can only be called in Select statement whereas CASE can be used in PL/SQL Block.
Decode is going to check equality of two or more values whereas CASE can work with equality as well as other operators like less than, greater than, IN, BETWEEN, LIKE etc..
Decode works with scalar values whereas CASE can also work with searchable queries.

Exec Myproc(Case :input when 'True' then 1 Else 0 End);

Exec Myproc(DECODE(:input,'True',1,0);
Case executes much faster than DECODE.

#GoLearningPoint

For Interview questions and other topics -
https://tipsfororacle.blogspot.com/

🎧 Just For You

🎵 Sapphire - Ed Sheeran 🎵 What I Want - Morgan Wallen Feat. Tate… 🎵 Happy - Pharrell Williams 🎵 Daisies - Justin Bieber 🎵 Be Mine - Kamrad 🎵 I Gotta Feeling - Black Eyed Peas 🎵 Someone Like You - Adele 🎵 Just The Way You Are - Bruno Mars 🎵 Golden - Huntr/X, Ejae, Audrey Nuna, Rei… 🎵 Blinding Lights - The Weeknd 🎵 Soda Pop - Saja Boys 🎵 We Found Love - Rihanna Feat. Calvin…