5. Which SQL statements wocould display the value 1890.55 as $1,890.55? (Choose three .)
A. SELECT TO_CHAR (1890.55, '$0G000D00') from dual;
B. SELECT TO_CHAR (1890.55, '$9, 999v99') FROM DUAL;
C. SELECT TO_CHAR (1890.55, '$99,999 d99') from dual;
D. SELECT TO_CHAR (1890.55, '$99G999D00') from dual;
E. SELECT TO_CHAR (1890.55, '$ 99g999d99') from dual;
Answer: ADE
Question Analysis:
G (group) is the group separator ','
D (decimal point) is the decimal point
V indicates the number of digits that move the decimal point to the right, such as to_char (10.5, '99v999') '123'
0 indicates completion. If there is no number at this position, 0 is filled. It is different from 9. If there is no number at this position, leave it blank. For example, to_char (1000, '123') '123 ',
To_char (1000, '20170101') '20160301 '.
From the above we can see that B is wrong.
C option SELECT TO_CHAR (1890.55, '$99,999 d99') from dual;
This error occurs because the group separator is a symbol and the decimal point is a letter. In this case, an error is returned, which can be changed to the same
SELECT TO_CHAR (1890.55, '$99,999.99') from dual;
Or
SELECT TO_CHAR (1890.55, '$ 99g999d99') from dual;
Are correct.