1. Standard SQL specification
One, single IF1, if A= ... Then.........end if;2, if a= ... then......else....end if; two, more IfIf a=. Then......elsif a=. Then....end if; The middle here is "elsif", not else IF. Special attention is needed here.
2. Decode function
syntax for decode :
DECODE (Value,if1,then1,if2,then2,if3,then3,..., else)
Indicates that if value equals IF1, the result of the Decode function returns THEN1,..., if it is not equal to any one if value, else is returned.
3. Case
Case when a= ' 1 ' and ' xxxx ' when a= ' 2 ' then ' ssss ' else
' Zzzzz ' End as
Note the point:
1. Start with case and end With end
2. When the branch is followed by the condition, then the result is displayed
3, else in addition to the default, similar to the high-level language program switch case default, you can not add
4, END followed by alias
Category: Db-oracle
Oracle in If/else