How to cast as decimal in postgresql?

Member

by ryleigh , in category: MySQL , a month ago

How to cast as decimal in postgresql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by wilmer.lemke , a month ago

@ryleigh 

To cast a value as a decimal in PostgreSQL, you can use the CAST function. Here is an example:

1
SELECT CAST(column_name AS decimal) FROM table_name;


Replace column_name with the name of the column you want to cast as a decimal and table_name with the name of the table where the column is located.