Re: Conditional SQL query

Поиск
Список
Период
Сортировка
От Indraneel Majumdar
Тема Re: Conditional SQL query
Дата
Msg-id Pine.SGI.3.96.1001106010028.1000241C-100000@www.cdfd.org.in
обсуждение исходный текст
Ответ на Conditional SQL query  (Indraneel Majumdar <indraneel@www.cdfd.org.in>)
Список pgsql-sql
On Sun, 5 Nov 2000, Marten Feldtmann wrote:

> Indraneel Majumdar schrieb:
> > 
> > Hi,
> > 
> > how can I insert a record after checking whether one of the fields has a
> > certain value or not? eg:
> > 
> > if table(col1)='value' insert into table values (x,x,x)
> > 
> > I am using perl interface. Is there any way to define a function to take
> > table name as an argument? (eg: select * from $table) I tried but this
> > gave an error (so I'm using perl to pass the real tablename for each
> > query)
> > 
> 
> insert into table select ... where col1 = 'value'
> 

this is working but I am inserting values directly and not by select. eg:

insert into table values(x,x,x)
and not
insert into table select * from table2

the former is not working.

\Indraneel

> 
> MF
> 

/************************************************************************.
# 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                                              #
`************************************************************************/



В списке pgsql-sql по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Time penalty on VIEWS on VIEWS
Следующее
От: "Cristóvão B. B. Dalla Costa"
Дата:
Сообщение: Re: Conditional SQL query