Mi2830
Mi2830

Reputation: 319

How to subtract two columns in Informix 12.10

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?

Upvotes: 1

Views: 194

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521997

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;

Upvotes: 1

Related Questions