Whether prompt please whether in Postgre SQL 8.4 to use variables in requests (not in functions)? rummaging in the internet, I understand that they are not ((
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, --Π’Π°Π±Π»ΠΈΡΠ° 'company_id' AS column1 --ΡΡΠΎΠ»Π±Π΅Ρ ; SELECT * FROM (SELECT imptable FROM tempp) a where (SELECT column1 FROM tempp) >1; I thought it would work, and it will look in test.ss, but no:
SELECT * FROM (SELECT imptable FROM tempp) makes a choice not from test.ss but from tempp , because in fact he sees my subquery as a table, and not as a word that I want to substitute into the script
I want to get the result as if I wrote
SELECT * FROM test.ss Tell me what to do if there are normal variables, without using functions? If not, how else can you use something like variables in queries, change something in one place, so as not to edit the whole query