Re: How to check: is some key referenced from sometable

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: How to check: is some key referenced from sometable
Дата
Msg-id 20030809150809.GA22927@wolff.to
обсуждение исходный текст
Ответ на How to check: is some key referenced from sometable  (evl@my-mail.com.ua)
Ответы Re: How to check: is some key referenced from sometable  (eVl One <evl@my-mail.com.ua>)
Список pgsql-sql
On Mon, Aug 04, 2003 at 11:17:56 +0300, evl@my-mail.com.ua wrote:
> Please help.
> 
> Need a boolean function which returns true if given key in table is
> referensed from another table(s).

Use "exists" with a subselect. Something like:
select exists(select 1 from table where table.key = 'value');


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error message with a SQL function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Comparing arrays