> From: [email protected] [mailto:[email protected]] On Behalf Of Jan Verheyden > Subject: [SQL] simple? query > > Hi, > I was trying to run following query but doesn't work: > if (uid='janvleuven10') then > insert into test (registered) values ('1'); > else > insert into test (registered) values ('0'); > end if;
Perhaps UPDATE is what you're looking for? http://www.postgresql.org/docs/8.4/static/sql-update.html UPDATE test SET registered = '1' WHERE uid = 'janvleuven10'; UPDATE test set registered = '0' WHERE uid <> 'janvleuven10'; Mike -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
