Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AVG of un normalized data

a_yavuzJan 2 2011 — edited Jan 3 2011
Hi,

I have a table as TFORM_RESULTS. And a column VANSWERS in that table. I keep the answers in that column as like "12:3:5:18". Simply my table data is like this:
TFORM_RESULTS

ID      VANSWERS     NFORM_ID 
1       12:3:5:6:7       2
2       13:2:3:2:4       2
3       10:8:1:3:4       2
4       19:4:6:3:7       2
The reason that i keep data un-normalized is maybe VANSWERS may change. In this example we have 5 answers but for NFORM_ID = 6 we may have 8 answers. But for the same FORM_ID we have equal answer count.

I would like to get the average of this answers as like this:
AVG 
13,5:4.25:3,75:3,5:5,5
Is there a simple way to get average as like this? I use APEX_UTIL.STRING_TO_TABLE to parse the column. There maybe simple solutions.

Thanks.

yvz
This post has been answered by Solomon Yakobson on Jan 2 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2011
Added on Jan 2 2011
12 comments
817 views