Try:
SELECT data.*,
TRIM(TRAILING '0' from ExchangeRate) AS ExchangeRateTrimmed
FROM (.
... the subquery ...
) data
Hovever, this query returs all columns from the subquery (including ExchangeRate
column) plus a new, additional column - ExchangeRateTrimmed
.
Unfortunately ANSI SQL standard doesn't have a shotrtcut using '*' with the semantic "give me all columns, but modify only one of them" nor "give me all columns except one".
For now SELECT *
means "give me all columns - as they are in the table (or subquery), without the ability to change them".
If you want to change one column using an expression, then you must list all of the others columns in the SELECT clause:
SELECT col1,
col2,
.....
expression on col X [as col_name],
....
colN
FROM table