QuestionQ243

VerifiedUsing Single-Row Functions to Customize Output

The following data is present in the PRODUCTS table:

PROD_ID  PROD_LIST_PRICE  
------------------------  
123456   152525.99  

You run the following query:

SQL> SELECT RPAD(( ROUND(prod_list_price)), 10, '*')  
  2  FROM products  
  3  WHERE prod_id = 123456;  

What is the outcome?

Explanation

Oracle ROUND with no precision argument rounds a number to zero decimal places, producing 152526 from 152525.99. RPAD right-pads its first character expression to a total length of 10 with the supplied pad string, so the six-character result receives four * characters.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!