Re: EXISTS - Mailing list pgsql-sql

From Denis Woodbury
Subject Re: EXISTS
Date
Msg-id BLU0-SMTP2556233E6F183278C27702CB310@phx.gbl
Whole thread Raw
In response to Re: EXISTS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Thanks to those who responded, I see PL/PgSQL is the way to go

Regards, denis woodbury



on 10/11/08 1:32 PM, [NAME] at [ADDRESS] wrote:

> Denis Woodbury <denis@woodmic.net> writes:
>> I would like to know if this this type of statement can be used in
>> Postgresql
> 
>> IF NOT EXISTS (SELECT 1 FROM Table WHERE col1 = 'mystring' )
>> BEGIN
>> ...
>> END
> 
> I suspect you are trying to type that directly into SQL.
> You need to be using plpgsql in order to use procedural
> logic (ie, if/then).
> 
> regards, tom lane




pgsql-sql by date:

Previous
From: Craig Ringer
Date:
Subject: Re: EXISTS
Next
From: "Fernando Hevia"
Date:
Subject: Re: SELECT multiple MAX(id)s ?