您的位置:首页 > 其它

OCP-1Z0-051 第75题 ROUND和RPAD函数

2014-05-08 12:03 218 查看
一、原题

The following data exists in the PRODUCTS table:

PROD_ID   PROD_LIST_PRICE

    123456                 152525.99

You issue the following query:

SQL> SELECT RPAD(( ROUND(prod_list_price)), 10,'*')

             FROM products

          WHERE prod_id = 123456;

What would be the outcome?
A. 152526****
B. **152525.99

C. 152525** **

D. an error message

答案:A


二、题目翻译

下面是PRODUCTS表中的数据

执行下面的SQL查询语句

执行结果是什么?

三、题目解析

表中 prod_list_price的值是152525.99,ROUND函数如果不写第二个参数,就是默认是0,保留到整数,

而ROUND四舍五入,所以ROUND(prod_list_price)=152526,

RPAD右填充函数,RPAD(( ROUND(prod_list_price)), 10,'*')表示,保留10个长度,如果不够,使用*填充,

所以RPAD(( ROUND(prod_list_price)), 10,'*')的结果为152526****
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  OCP-1Z0-051 ROUND RPAD 11g