lundi 2 décembre 2019

If statement with select in Postgresql

I've having trouble to do a if with select, e.g:

In SQL Server I can do this:

IF NOT EXISTS (SELECT  1 FROM mytable where "name" = 'myname')
BEGIN
    /*Do something*/
END
GO

But in postgresql I don't have any idea how handle this. I've tring some ways to do this, but unfortunately I have not success.

Aucun commentaire:

Enregistrer un commentaire