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:

  • War Thunder là gì? Top cấu hình máy tính chơi War Thunder
  • Cách tạo và tùy chỉnh màn hình khóa iOS 16 cho iPhone
  • Top 10 phần mềm quản lý bất động sản tốt nhất hiện nay
  • 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
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:
    3 years ago

    Is DECODE essentially the same as CASE?

    Reply
  2. Rikka says:
    3 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:
    3 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.

Hội nghị xúc tiến đầu tư Auscham – Liên kết để phát triển | THDT

Hội nghị xúc tiến đầu tư Auscham – Liên kết để phát triển | THDT

May 29, 2020
Oppo R11s Plus First Look – Oppo 20MP Camera Smartphone [4k]

Oppo R11s Plus First Look – Oppo 20MP Camera Smartphone [4k]

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

© 2023 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ệ

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