473,383 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 3668

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JP Belanger | last post by:
I have a question on select count(), which may betray my lack of database knowledge. Here goes. I have java code driving a transaction which goes like this: select count(*) from table ...
0
by: Fatt Shin | last post by:
Hi, I'm running MySQL 4.0.13, connecting from PowerBuilder 9 using ODCB Connector 3.51. I'm facing a problem where whenever I issue a SELECT COUNT(*) statement from PowerBuilder, I always get SQL...
0
by: gord barq | last post by:
I have a table I'm using for logging purposes with a schema like: create table results ( user varchar(255) .... ); Where user is not a unique field and I want to find out how many unique...
3
by: Hunter | last post by:
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...
2
by: Chris | last post by:
Hello all, I'm having some trouble setting up a query. Background: The table TBLSCREEN stores data about screenings of patients/subjects for eligibility to participate in a health study. A...
4
by: Danielle | last post by:
I have data like this in a two column temporary table - ID Age 23586 3 23586 3 23586 2 23586 2 23586 1 23586 1
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
14
by: lewindletter | last post by:
Hi If I do Begin transaction Stmt 1: select count(*) from tableA If the count is zero, then proceed to the following Stmt 2: insert "something" to tableA Stmt 3: insert "something" to...
8
by: bettina top | last post by:
how can i count the digits of number given by the user
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.