How to get a date in percent in Postgresql?

Switched to Postgres, and some things easily done in MySQL does not work as easily done in PostgreSQL.
Here there are two fields with datetime (timestamp without gmt) - start date and end. Need to get a percentage how much is left came to the end date of the current time. In MySQL it is possible to do this query:
select ((end_date - now()) * 100) / (end_date - begin_date) from table


The result will be how many percent is completed.
And Postgres how to do it?
July 12th 19 at 20:16
1 answer
July 12th 19 at 20:18
Solution
select (EXTRACT(epoch FROM end_date - now()) * 100) / EXTRACT(epoch FROM end_date - begin_date) from table
Thank you! It's all good! - omari95 commented on July 12th 19 at 20:21

Find more questions by tags PostgreSQLSQL