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

Help! Select count from a list of digits ??

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a

"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.