Я выбираю несколько столбцов из таблицы, например. type, orno, dsca
, et c.
Я хочу отображать значение 'dsca' в зависимости от значения 'type'. Если 'type' = 9 или 10, тогда dsca = 'something' еще dsca берется из таблицы
select
orno, dsca,type
from
ttxdes102
where
type in (1, 4, 9, 10)
and IF (type = 9 or type = 10) then dsca = 'Unallocated' END
The actual table is:
| orno | type | dsca |
| AV003 | 10 | null |
| HN001 | 1 | Sales Inv. |
| HR007 | 9 | null |
| HQ001 | 2 | Advance Rcpt |
I want to display it as:
| orno | type | dsca |
| AV003 | 10 | Unallocated |
| HN001 | 1 | Sales Inv. |
| HR007 | 9 | Unallocated |
| HQ001 | 2 | Advance Rcpt |