Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Opration On Decimal Values

PHKAug 8 2016 — edited Aug 9 2016

Hello Friends,

I have one problem with decimal values. Here is scenario.

CREATE TABLE TEST

(ID   NUMBER(3,0),

VALUE NUMBER(5,2));

INSERT INTO TEST VALUES(1,0.22);

INSERT INTO TEST VALUES(2,1.22);

INSERT INTO TEST VALUES(3,55.22);

INSERT INTO TEST VALUES(4,666.22);

INSERT INTO TEST VALUES(5,2.2);

INSERT INTO TEST VALUES(6,22);

INSERT INTO TEST VALUES(7,58.6);

COMMIT;

Now if I fire a select query here by concatenating value column with a string observe the result.

select VALUE, value||' cm' from test;

Value
Value with String
0.22.22 cm
1.221.22 cm
55.2255.22 cm
666.22666.22 cm
2.22.2 cm
2222 cm
58.658.6 cm

Observe First Record. My actual Value is 0.22. Why It is showing .22

Thanks in Advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2016
Added on Aug 8 2016
12 comments
883 views