Search Postgresql Archives

Help on constructing a query that matches array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux