mardi 4 août 2020

IF condition with Postgres; ERROR: syntax error at or near "END" Position: 799

I'm trying to write a sql query to pick some columns based on predetermined conditions.I removed the ELSEIF THEN following block from the code pasted below for which I get the following error:ERROR: syntax error at or near "END" Position: 799 Could you please help?

Do $$
BEGIN
IF  THEN
SELECT colA,colB
   FROM"XXX"  
 
END IF;
END;
$$ 

Aucun commentaire:

Enregistrer un commentaire