Skip to content
Advertisement

How to show decimal value separately in PostgreSQL?

I have a table named c_price and have a column value like below in PostgreSQL.

Now need a query for below result.

Advertisement

Answer

trunc() and mod() may be used

dollars | cents
------: | ----:
    123 |    67

db<>fiddle here

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