| От | BlackMage |
|---|---|
| Тема | Help on constructing a query that matches array |
| Дата | |
| Msg-id | 27234475.post@talk.nabble.com обсуждение исходный текст |
| Ответы |
Re: Help on constructing a query that matches array
|
| Список | pgsql-general |
Hey all,
I need help on constructing a query with arrays that matches the arrays up
as foriegn keys to another table. For example, say that I have two tables,
owners and pets.
Owner Table
owner_id | pet_ids
1 | {1,2,3}
2 | {2,3}
Pet Table
pet_ids | Pet Type
1 | Dog
2 | Cat
3 | Fish
4 | Bird
Basically I am trying to create a SELECT query that returns the type of pets
an owner has by matching the pet_ids up. Can anyone help me with this?
--
View this message in context:
http://old.nabble.com/Help-on-constructing-a-query-that-matches-array-tp27234475p27234475.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера