(Contents)(Previous)(Next)

Creating Bar Charts

SELECT name, account, LPAD(' ',TRUNC(account/100),'*',50) graph

FROM customer

WHERE account > 0

ORDER BY account DESC

LPAD inserts asterisks just before the first parameter (here a blank). This is done according to the number given by account divided by 100.

RPAD inserts asterisks to the right of the blank.


(Contents)(Previous)(Next)