Search Postgresql Archives

Array extraction

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

 



Hi!

I have such table:

user_group
---------------------------------
ug_id -> serial primary key
ug_users -> int4[]

For example table has such rows:
 ug_id | ug_users

-------+--------------
1 | { 2,5,6 }
2 | { 3,4,9 }
I want to write SQL-query or write user defined function to get such result (extract array values):
 ug_id | ug_users
-------+--------------
1 | 2
1 | 5
1 | 6
2 | 3
2 | 4
2 | 9

Help please to solve this problem.
--
Vadim


[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