I run a query like this:
SELECT (SELECT expire_date FROM "License" WHERE license_id = 10)
- interval '1 mon 133 days 22:19:49.191748'
And everything is well.
But when I try this:
SELECT (SELECT expire_date FROM "License" WHERE license_id = 10)
- interval ((SELECT expire_date-now() FROM "License" WHERE license_id = 10)
+ interval '1 months')
I get an error:
ERROR: syntax error at or near "("
LINE 1: ...FROM "License" WHERE license_id = 10) - interval ((SELECT ex...
^
Please help, thanks.
My understanding is that Postgres allows the type 'string' syntax for specifying the type for simple literal constants. For anything else you have to use ...::type or CAST ( ... AS type ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With