Skip to content
Advertisement

How to assign result of a sql query to a variable and use it into a built in function?

Looking for a solution In Postgresql

Advertisement

Answer

SQL has no variables, so short of using a function, you can use a common table expression:

Or just:

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