SQL - How do I get only the numbers after the decimal?

Viewed 197345

How do I get only the numbers after the decimal?

Example: 2.938 = 938

13 Answers

I had the same problem and solved with '%' operator:

select 12.54 % 1;

X - TRUNC(X), works for negatives too.

It would give you the decimal part of the number, as a double, not an integer.

It's Gives You Only Decimal Values

Input : select (18.45)%1

OutPut

0.45

Related