Re: Conditional SQL query

From: Indraneel Majumdar <indraneel(at)www(dot)cdfd(dot)org(dot)in>
To: Cristóvão B(dot) B(dot) Dalla Costa <cdallacosta(at)bigfoot(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Conditional SQL query
Date: 2000-11-06 10:23:33
Message-ID: Pine.SGI.3.96.1001106021935.1002323B-100000@www.cdfd.org.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)123india(dot)com #
# Bioinformatics Unit (EMBNET node), ¡ URL: http://scorpius.iwarp.com #
# Centre for DNA Fingerprinting and Diagnostics, #
# Hyderabad, India - 500076 #
`************************************************************************/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Tille 2000-11-06 11:10:54 Re: Returning Recordsets from Stored-procs
Previous Message Indraneel Majumdar 2000-11-06 10:00:50 Re: Conditional SQL query