how to INSERT foreign keys?

Поиск
Список
Период
Сортировка
От Phil Mitchell
Тема how to INSERT foreign keys?
Дата
Msg-id 4.3.2.7.2.20020210172848.00ac3bb0@pop.rcn.com
обсуждение исходный текст
Ответы Re: how to INSERT foreign keys?  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-novice
I have an <items> table, and a <keys> table, and a map table that relates
item_id's to key_id's. How do I populate item_keys with data?

I tried:

INSERT INTO item_keys SELECT item_id from items where item = 'item 1',
SELECT key_id from keys where key = 'key 1';

but the parser doesn't like that.

Thanks!


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

Предыдущее
От: "Eric Peters"
Дата:
Сообщение: Re: How would I make this into a stored procedure? (Solved)
Следующее
От: John Taylor
Дата:
Сообщение: Re: Using indexes and keys