Answer the question
In order to leave comments, you need to log in
What's wrong with the if request?
Learning if queries in PostgreSQL.
I can not understand why it swears at an error in the request:
IF SELECT age FROM peoples where id = 2 > 1 THEN
SELECT 1+1
END IF;
Answer the question
In order to leave comments, you need to log in
Maybe so?
DO
$do$
BEGIN
IF EXISTS(SELECT age FROM peoples where id = 2 > 1) THEN
SELECT 1+1
END IF;
END
$do$
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question