472,378 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 3599

"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
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.