OCP-1Z0-051-Question Analysis-5th question

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.