i got a great book off of amazon.com called "SQL: A Beginner's Guide". It is easy enough for a beginner, but has all the info you could need. It should be called "SQL: The Complete Guide" heheh.
Its small too at only 400 pages which means not alot of word-bloat which is good when your thinking "i just want to know how to do this!!". check it out if you want: http://www.amazon.com/exec/obidos/tg/detail/-/0072130962/qid=1046632293/sr=1 -2/ref=sr_1_2/103-0702335-8946250?v=glance&s=books ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 02, 2003 11:05 AM Subject: Re: Witango-Talk: searching for elegant count sql statement > Awesome, exactly what I needed. I could not get the group summary in the > search action to come up with that statement. If one you knows how, I'd be > very interested. In the meantime, I need to learn more SQL! I'm using Sql > Server, and I only had to change sel to select for the query to work. > > John Newsom > > the sql of tally... nicely done > > -----Original Message----- > > From: Atrix Wolfe <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > Date: Sunday, March 02, 2003 10:49 AM > > Subject: Re: Witango-Talk: searching for elegant count sql statement > > > > > > wait, take out the distinct and add studentname into the results, so you get > > this: > > > > sel studentname count(studentname) from tablename group by studentname > > > > > > ----- Original Message ----- > > From: Atrix Wolfe > > To: [EMAIL PROTECTED] > > Sent: Sunday, March 02, 2003 10:42 AM > > Subject: Re: Witango-Talk: searching for elegant count sql statement > > > > > > this should do what your looking for: > > > > sel count(distinct studentname) from tablename group by studentname > > > > if i understand you correctly > > ----- Original Message ----- > > From: Brent Skean > > To: [EMAIL PROTECTED] > > Sent: Sunday, March 02, 2003 10:23 AM > > Subject: Re: Witango-Talk: searching for elegant count sql statement > > > > > > oops, disregard that last one, I misread your question. > > > > Brent > > > > -----Original Message----- > > From: John Newsom <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > Date: Sunday, March 02, 2003 10:08 AM > > Subject: Witango-Talk: searching for elegant count sql statement > > > > > > Hi, I have a database with a table which contains multiple > > student id's, > > > > > > > > +----------+------------------+------+-----+---------+----------------+ > > | Field | Type | Null | Key | Default | Extra | > > > > +----------+------------------+------+-----+---------+----------------+ > > | projID | int(11) | | | 0 | | > > | stuID | int(11) | | | 0 | | > > | rank | int(11) | | | 0 | | > > | uniqueID | int(10) unsigned | | MUL | NULL | auto_increment | > > > > +----------+------------------+------+-----+---------+----------------+ > > 4 rows in set (0.00 sec) > > > > most occurring more than once since a student may make multiple > > requests which are stored in the table. I want to count the number of times each > > student name occurs, and then store the frequency in an array. I thought that > > the sql count function would help, but it seems not directly. I had to first do > > a search to find each unique id (using distinct), then with a for loop iterate > > through the resultset, and do a search for each id, and then add each numrows > > value to an array. > > > > I also tried bracketing the second search between two results > > html with a beginning and ending rows loop, but that doesn't seem to work > > either! > > > > So, short version is I have the thing working (see attached taf) > > but seems like a lot of work that should be able to be accomplished in a single > > select statement. > > > > Thanks for any insights. > > > > John Newsom > > > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > > > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > ________________________________________________________________________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
