Answer the question
In order to leave comments, you need to log in
How to use variables in a query in Postgre SQL 8.4?
Can you please tell me whether it is possible to use variables in the queries themselves (not in functions) in Postgre SQL 8.4?
rummaging through the internet, I realized that there are none ((
so I decided to cheat and use a temporary table to take the necessary parameters from it.
For example:
CREATE TEMP TABLE tempp ON COMMIT DROP
AS
SELECT 'test.ss' AS imptable, --Table
'company_id' AS column1 --column ;
SELECT * FROM (SELECT imptable FROM tempp) a
where (SELECT column1 FROM tempp) >1;
SELECT * FROM (SELECT imptable FROM tempp)
SELECT * FROM test.ss
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question