Home > database >  Decode and instr function used in combination
Decode and instr function used in combination

Time:05-21

Encounter a statement
 select itemcode, 
Cuscode,
The SUM (decode (INSTR (opname, 'before treatment),
'1',
Waitqty,
0)) as qcldqty
The from BBREPORT c
Group by itemcode, cuscode

Combine decode and instr function is used, what is the meaning of this statement

CodePudding user response:

Seems a appear in find opname 'treatment before the position of the string, if position is 1, the sum (waitqty), otherwise the sum (0)
  • Related