---
title: "oracle decode 的自我见解"
author: "javaEEdevelop"
date: "2012-10-17T17:50:42Z"
tags: []
categories: ["数据库"]
slug: "oracle-decode"
draft: false
lastmod: "2012-10-17T17:50:42Z"
id: 1700492
url: "https://javaeedevelop.iteye.com/blog/1700492"
---

```
select decode(1,2,3,11,4,15,11,14,19,17)  tt from dual;

if 1=2 then
  3
elsif 1=11 then
  4
elsif 1=15 then
  11
elsif 1=14 then
  19
 elsif 1=17 then
 17
 endif;
 
select decode(1,2,3,11,4,15,11,14,19,1,2,4)  tt from dual;
 
 if 1=2 then
  3
elsif 1=11 then
  4
elsif 1=15 then
  11
elsif 1=14 then
  19
 elsif 1=1 then
 2
 endif;
```