By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

retreive values from an array into column

P: 38
Dear all,
can any one solve this problem.....
i have a table name as course which has following columns

cid as serial (PK)
course_id as int
student as int4[]

and course table looks like this

cid + course_id + students
1 +10 + {501,525,575}
2 +20 + {625,635,638,789,895}
3 +30 + {698,798,425,635}

i want to extract course_id and students in another table name as seminar
sid as serial (PK)
course_id as int
students as int4

my result in seminar should look like this

sid + course_id + students
1 +10 + 501
2 + 10 + 525
3 + 10 + 575
4 + 20 + 625
5 + 20 + 635
6 + 20 + 638
7 + 20 + 689
8 + 20 + 695
9 + 30 + 698
10 + 30 + 798
11 + 30 + 425
12 + 30 + 635

if some gives smart solution...... i m pending here a lot n wasting my time

thanx....
Jan 19 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.