469,955 Members | 2,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Help! Select count from a list of digits ??

Hi group - I'm using php to extract data from postgres and print to
browser. I have data that was input through checkboxes on a form -
each checkbox had a different value but got pushed into the same
column.

So - my values look like this:
surveys=# select distinct(additionaldeliverablearray) from csssurvey;
additionaldeliverablearray
----------------------------

1,2,3,19,23
1,8,10
19,23
2,7,10,23
3,5,7,12,13,14,17,19,20,22
4,8,9,10,12
6,7,10,12,17,20,21
6,9,10,12,17,20
(9 rows)

I need to be able to *count* how many distinct numbers were checked ?

I've tried
select count where additionaldeliverablearray like ('1')
select count where additionaldeliverablearray in ('1')

Any ideas ??

THANK YOU!

Syl.
Jul 19 '05 #1
1 3466

"Hunter" <th*******@rogers.ca> wrote in message
news:ht******************@twister01.bloor.is.net.c able.rogers.com...
Hi group - I'm using php to extract data from postgres and print to
browser. I have data that was input through checkboxes on a form -
each checkbox had a different value but got pushed into the same
column.

So - my values look like this:
surveys=# select distinct(additionaldeliverablearray) from csssurvey;
additionaldeliverablearray
----------------------------

1,2,3,19,23
1,8,10
19,23
2,7,10,23
3,5,7,12,13,14,17,19,20,22
4,8,9,10,12
6,7,10,12,17,20,21
6,9,10,12,17,20
(9 rows)

I need to be able to *count* how many distinct numbers were checked ?

I've tried
select count where additionaldeliverablearray like ('1')
select count where additionaldeliverablearray in ('1')

Any ideas ??

THANK YOU!

Syl.


try with this:
surveys=# select count(distinct(additionaldeliverablearray))
from csssurvey;

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by JP Belanger | last post: by
reply views Thread by gord barq | last post: by
22 posts views Thread by MP | last post: by
14 posts views Thread by lewindletter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.