• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

Query Syntax

Hello,
I have a numeric field in my oralce table contains the following values:

x
-----
12.55
875.69
325.6
2.53
12.56
....
....

I want to write query to get the following values according to x in y numeric field.

y
------
55.12
69.875
6.325
53.2
56.12
.....
.....

It means I want to replace numbers before decimal point by numbers after decimal point and vice versa.

Thanks
-FA


0
Farzad Akbarnejad
Asked:
Farzad Akbarnejad
1 Solution
 
sdstuberCommented:
TO_NUMBER(REGEXP_REPLACE(TO_CHAR(x), '([^.]*)\.([^.]*)', '\2.\1'))
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now