I would like to subtract a column from another column in Informix 12.10.
SELECT
NAME,
PRICE1
PRICE2,
(PRICE1 - PRICE2) AS VALUE
FROM PRODUCTS
Does somebody have an idea how can I do that?
CodePudding user response:
VALUE
is a keyword in IBM Informix SQL. Use something else for the alias, or, if you must use VALUE
, then wrap it in double quotes.
SELECT
NAME,
PRICE1
PRICE2,
(PRICE1 - PRICE2) AS "VALUE"
FROM PRODUCTS;