Previous Topic Next topic Print topic


VALUE

ANSI DB2 SQL/DS XDB
  X   X

If x is evaluated as null, VALUE returns the value of the first non-null y. The format appears below:

VALUE(x, y1 [,...yn])

For example, in the query below, the column named COM is null for some employees; the desired value is then the employee's payrate or, failing that, simply the value 10. For example:

SELECT e_no, VALUE(com * $300, payrate, $10)
  FROM employee
  WHERE st = "VA"
e_no
column2
2 $17.50
4 $17.50
7 $9.00
9 $17.00
Previous Topic Next topic Print topic