pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Henry Ortega <juandelacruz@gmail.com>
To: pgsql-sql@postgresql.org
Subject: insert only if conditions are met?
Date: Wed, 31 Aug 2005 11:09:54 -0400
Message-ID: <2bffcc33050831080942f806e1@mail.gmail.com> (raw)

Is there a way to insert a record only if a certain
condition is met?

Something like:
insert into employee values('lastname','firstname',8) where
(condition here.. select sum(ofsomething) from xx where sum(ofsomething)>0 )

Is this possible at all with just plain SQL?

view thread (14+ messages)  latest in thread

Message-ID: <2bffcc33050831080942f806e1@mail.gmail.com>
Permalink:  ../2bffcc33050831080942f806e1@mail.gmail.com/
Also on:    postgresql.org/message-id/2bffcc33050831080942f806e1@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: juandelacruz@gmail.com
  Subject: Re: insert only if conditions are met?
  In-Reply-To: <2bffcc33050831080942f806e1@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox