Skip to content
Advertisement

How to move decimal places in SQL

I want to place a decimal between the first and second digit of the interest rate and keep 2 trailing after the decimal. How do I go about doing this?

This is my current result:

This is my desired result:

EDIT: I ended up using this to get the correct interest rate

Advertisement

Answer

Strange format; you cannot handle interest rates less than 1%.

You can do:

This converts the value to a number, adds the decimal place, and converts to a decimal.

Here is a db<>fiddle.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement