postgres convert text to number 1

postgres convert text to number

SELECT ' 5800.79 '::INTEGER;

Here is what the above code is Doing:
1. We’re creating a new table called “numbers” with a single column called “numbers”
2. We’re inserting a single row into the table, with the value 5800.79
3. We’re selecting the value of the single row in the “numbers” table and casting it as an integer

If you need a hint, here’s a link:
http://www.postgresqltutorial.com/postgresql-cast/

Similar Posts