Tech News, Magazine & Review WordPress Theme 2017
  • Home
  • Chứng Khoán
  • Kinh Doanh
  • Start Up
  • Tài Chính
  • Công Nghệ
No Result
View All Result
  • Home
  • Chứng Khoán
  • Kinh Doanh
  • Start Up
  • Tài Chính
  • Công Nghệ
No Result
View All Result
Sangoivon - Chuyên trang tin tức kinh doanh hàng đầu Việt Nam
No Result
View All Result

Oracle DECODE Function

admin by admin
July 2, 2020
Home Công Nghệ
Share on FacebookShare on Twitter



The Oracle DECODE function lets you perform IF-THEN-ELSE functionality in your queries. It’s similar to a CASE statement.

The syntax of the DECODE function is:

DECODE ( expression, search, result [, search, result]… [,default] )

The parameters of the Oracle DECODE function are:

– expression (mandatory): This is the value to compare.
– search (mandatory): This is the value to compare against the expression.
– result (mandatory): This is the return value if the search value matches the expression value. There can be multiple combinations of search and result values, and the result value is attached to the previous search value.
– default (optional): If none of the search values match, then this value is returned. If this is not provided, the DECODE function will return NULL if no matches are found.

If you compare this to an IF-THEN-ELSE statement, it would look like this:

IF (expression = search) THEN result
[ELSE IF (expression = search) THEN result]
ELSE default
END IF

The parameters can be one of many different data types, and the return type is calculated from them.

Earlier I mentioned it’s similar to CASE. So why would you use one and not the other?

– DECODE is an older function, and CASE was introduced as a replacement for DECODE.
– CASE offers more flexibility then DECODE
– CASE is also easier to read and debug (in my opinion)

The performance of these functions is the same, so if you’re considering using DECODE, I would suggest using CASE instead.

For more information about the Oracle DECODE function, including all of the SQL shown in this video and the examples, read the related article here:

Nguồn: https://sangoivon.com

Xem thêm bài viết khác: https://sangoivon.com/cong-nghe/

Xem thêm Bài Viết:

  • Nên mua ổ cứng HDD hãng nào? Top HDD tốt nhất hiện nay
  • Những thắc mắc thường gặp liên quan tới Ccleaner Pro
  • Top 3 phương pháp kéo traffic hiệu quả phục vụ cho SEO
  • Thay đổi hình thu nhỏ video Hình đại diện Donna Kelly
  • Pspice Cadence SPB OrCAD + Crack [Google Drive+Mega][Install Guide]
admin

admin

Next Post
Hướng Dẫn Tải Và Cài Đặt Game Outlast 2 Full Crack

Hướng Dẫn Tải Và Cài Đặt Game Outlast 2 Full Crack

Comments 3

  1. Lokcies says:
    2 years ago

    Is DECODE essentially the same as CASE?

    Reply
  2. Rikka says:
    2 years ago

    Sir, what if the problem is :
    Write a query to display the position of the letter "d" in each last name in the employees table, lowercase or uppercase letters are considered the same. Use the DECODE function

    Reply
  3. Abdirahim Ali says:
    2 years ago

    Well Explanation and Nice Voice

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Có Thể Bạn Quan Tâm.

[KHỞI NGHIỆP KINH DOANH] 9 Bước tìm ý tưởng kinh doanh

[KHỞI NGHIỆP KINH DOANH] 9 Bước tìm ý tưởng kinh doanh

May 21, 2020
Top 10 OFFLINE Pokemon Games Android/IOS | Best Pokemon Games 2020 HD Graphics | With Download Links

Top 10 OFFLINE Pokemon Games Android/IOS | Best Pokemon Games 2020 HD Graphics | With Download Links

July 1, 2020
  • Chính Sách Bảo Mật
  • Liên Hệ

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Chứng Khoán
  • Kinh Doanh
  • Start Up
  • Tài Chính
  • Công Nghệ

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.