Hi, all! I have Postgresql and query
SELECT
complex_expression()
FROM
t
WHERE
complex_expression() != '';
Is there a way to write complex_expression()
only once in query and then refer to it? Thanx in advance
Hi, all! I have Postgresql and query
SELECT
complex_expression()
FROM
t
WHERE
complex_expression() != '';
Is there a way to write complex_expression()
only once in query and then refer to it? Thanx in advance
select * from
(
SELECT complex_expression() ce
FROM t
)
where ce != '';
You can subquery
select * from
(
SELECT
complex_expression() as exp
FROM
t
)
WHERE
exp != '';