Two forms of judgment for Oracle's SQL statements
- Determine the current column and change the current column
- Determine if a situation changes other values
A kind of case in detail: the realization is that when the value of NUM column is 3 o'clock, it is displayed and so on
1) Case num
When 3 Then
Good
When 1 Then
Bad
Else
' OK '
End Taskresult The red Word is the alias of the column name to be judged can not be written
If NUM is a complex formula, it is easier to alias
2) Case
When num = 3 Then
Good
When num = 1 Then
Bad
Else
' OK '
End this method effect ibid.
Two types of situation: The realization is when num=3, score for score (good) and so on
Case
When num = 3 Then
Trim (score) | | (good) '
When yq.spqcreq = 1 Then
Trim (score) | | (Not good) '
Else
Trim (score) | | (also OK) '
End
Two forms of judgment for Oracle's SQL statements