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

🎵 Thinking Out Loud - Ed Sheeran 🎵 All The Way - Bigxthaplug Feat. Bailey… 🎵 The Door - Teddy Swims 🎵 Chains And Whips - Clipse Feat. Kendrick… 🎵 Bad Guy - Billie Eilish 🎵 Dior - Mk & Chrystal 🎵 Party Rock Anthem - Lmfao Feat. Lauren… 🎵 Forever Young - David Guetta, Alphaville… 🎵 Love Me Not - Ravyn Lenae 🎵 Someone Like You - Adele 🎵 Sorry Im Here For Someone Else - Benson… 🎵 Beautiful People - David Guetta & Sia