From: Indraneel Majumdar <indraneel@www.cdfd.org.in>
To: Cristóvão B. B. Dalla Costa <cdallacosta@bigfoot.com>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Conditional SQL query
Date: Mon, 6 Nov 2000 02:23:33 -0800 (PST)
Message-ID: <Pine.SGI.3.96.1001106021935.1002323B-100000@www.cdfd.org.in> (raw)
In-Reply-To: <Pine.SGI.3.96.1001106015029.1002323A-100000@www.cdfd.org.in>
OK, I solved my own problems (Congrats ;-) Sorry for bothering the list.
This is what I'm doing:
INSERT INTO table SELECT x,x,x where (select count(*) from table where
col1='value')=0;
any suggestions?
thanks,
Indraneel
On Mon, 6 Nov 2000, Indraneel Majumdar wrote:
> Now I have one more problem. How do I insert only once if value does not
> exist? eg:
>
> insert into table once select x,x,x where not col1='value'
>
/************************************************************************.
# Indraneel Majumdar ¡ E-mail: indraneel@123india.com #
# Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com #
# Centre for DNA Fingerprinting and Diagnostics, #
# Hyderabad, India - 500076 #
`************************************************************************/
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: indraneel@www.cdfd.org.in, cdallacosta@bigfoot.com
Subject: Re: Conditional SQL query
In-Reply-To: <Pine.SGI.3.96.1001106021935.1002323B-100000@www.cdfd.org.in>
References: <Pine.SGI.3.96.1001106015029.1002323A-100000@www.cdfd.org.in> <Pine.SGI.3.96.1001106021935.1002323B-100000@www.cdfd.org.in>
* 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