Here's a tricky SQL question that has definitely driven me to the end of
my rope. I'm using Oracle 9i and I need to perform some simple
multiplication on a field and then display it with a percent sign using
the COLUMN command. Here's the code thus far:
COLUMN price format 9,999.99 HEADING 'Charged%'
SELECT pricecharged * .231 as price
FROM VT_examdetail
The output from this reads:
Charged%
---------
23.10
34.65
34.65
....
The kicker here is that I need to add a percent sign to the right of the
output, so that it reads:
Charged%
---------
23.10%
34.65%
34.65%
....
I thought I could do this by just adding "|| ('%')" into the SELECT
statement, but when I do this the decimal position defined in the COLUMN
command is lost. Does anyone know another way around this?
Thanks,
Alex
my rope. I'm using Oracle 9i and I need to perform some simple
multiplication on a field and then display it with a percent sign using
the COLUMN command. Here's the code thus far:
COLUMN price format 9,999.99 HEADING 'Charged%'
SELECT pricecharged * .231 as price
FROM VT_examdetail
The output from this reads:
Charged%
---------
23.10
34.65
34.65
....
The kicker here is that I need to add a percent sign to the right of the
output, so that it reads:
Charged%
---------
23.10%
34.65%
34.65%
....
I thought I could do this by just adding "|| ('%')" into the SELECT
statement, but when I do this the decimal position defined in the COLUMN
command is lost. Does anyone know another way around this?
Thanks,
Alex
Comment