Which SQL statements would display the value 1890.55 as $1,890.55?

Which SQL statements would display the value 1890.55 as $1,890.55? (Choose three .)

Which SQL statements would 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,999D99′)
FROM DUAL;

D.
SELECT TO_CHAR(1890.55,’$99G999D00′)
FROM DUAL;

E.
SELECT TO_CHAR(1890.55,’$99G999D99′)
FROM DUAL;



Leave a Reply 16

Your email address will not be published. Required fields are marked *


awiersma

awiersma

why is C incorrect???

arun

arun

B is also correct answer if not so then can anyone explain it

arun

arun

B is incorrect answer sorry for inconvenience

melese

melese

why option C incorrect.
i think we should use . and ,or G and D
we can’t use , and D.what do you think?

Justyna

Justyna

C is incorrect because you cannot mix up in one format of a number coma, dot with G and D. It needs to be or coma and dot or D and G. Not
coma and D, not G and dot etc.

Hola

Hola

Have Justyna I have around 5 Question can’t find answers for among all 300. Could you please help me?

This is my email: [email protected]

chetan

chetan

anyone explain it.why A,D,E correct answer

Ritam Tiwari

Ritam Tiwari

Rules:
‘G’ stands for Comma.
‘D’ stands for Dot.
‘V’ removes the Dot.
‘,’ cannot be used with ‘D’.

eg: ‘$99,999D99’ is invalid.
‘$99G999D99’ is valid.

alis

alis

V example: 999V99
Returns a value multiplied by 10n (and if necessary, round it up), where n is the number of 9’s after the V.

Mohamed

Mohamed

Hi Alis,
is it valid dump as i have exam soon

is

is

A,D,E

SQL> select to_char(1890.55, ‘$0G000D00’) from dual;

TO_CHAR(18
———-
$1,890.55

SQL> select to_char(1890.55, ‘$9,999V99’) from dual;

TO_CHAR(1
———
$1,89055

SQL> select to_char(1890.55, ‘$9,999D99’) from dual;
select to_char(1890.55, ‘$9,999D99’) from dual
*
ERROR at line 1:
ORA-01481: invalid number format model

SQL> select to_char(1890.55, ‘$99,999D99’) from dual;
select to_char(1890.55, ‘$99,999D99’) from dual
*
ERROR at line 1:
ORA-01481: invalid number format model

SQL> select to_char(1890.55, ‘$99D999D00’) from dual;
select to_char(1890.55, ‘$99D999D00’) from dual
*
ERROR at line 1:
ORA-01481: invalid number format model

SQL> select to_char(1890.55, ‘$99G999D00’) from dual;

TO_CHAR(189
———–
$1,890.55

SQL> select to_char(1890.55, ‘$99G999D99’) from dual;

TO_CHAR(189
———–
$1,890.55

my explanation

my explanation

Yes! Finally someone writes about %keyword1%.|

Ofelia Romines

Ofelia Romines

Great blog.Thanks Again. Will read on…