RE: Help with Sum(), newbie

2002-10-10 Thread Lucas Engelen
> not a sum of all of the firsts. What I do want is a sum of > all of the numbers in column 5 where the date is after a > certain date, column 3 has "done" in it, and the url matches > a regular expression mysql. > > How do I do that? SELECT SUM(column5) FROM readdata WHERE processdate > '2

Re: Help with Sum(), newbie-- solved

2002-10-10 Thread Kevin
Thanks, Keith! That does what I want. I followed in the manual what I thought would work (page 163, 164). And, since the response from my entering in a query was always "hey stupid, you have to use the 'GROUP BY' when you do this," I never tried it without it. Anyway, that is just justification f

Re: Help with Sum(), newbie

2002-10-10 Thread Keith C. Ivey
On 10 Oct 2002, at 11:45, Kevin wrote: > SELECT column5, SUM(column5) FROM realdata WHERE processdate > "2002-8-31" > AND column3 = "done" AND url REGEXP "mysql"; > > Thus, I get the 1140 error. That's right. You can't get the individual values and the sum at the same time. The sum is a sing

RE: Help with Sum(), newbie

2002-10-10 Thread Artem Koltsov
select sum(first) from example; should work. Artem -Original Message- From: Kevin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 10:36 PM To: [EMAIL PROTECTED] Subject: Help with Sum(), newbie OK. Maybe I'm expecting too much of myself, but I can't figure out what I am

Re: Help with Sum(), newbie

2002-10-10 Thread Kevin
Thanks for the replies, Lucas, Terence, and John! John: I don't run Windows, so that will not help. Terence: No. I wanted the sums of all of the firsts...Lucas nailed it, but... Lucas: If I enter "SELECT SUM(first) FROM example;" it gives me the correct answer, 3. I created that simple database

Re: Help with Sum(), newbie

2002-10-10 Thread John Ragan
if you have a windows machine for a front end, download corereader from http://corereader.com/ it's free. it will connect to your mysql server (and anything else). it lets you do point and click queries, so you can very quickly experiment to get the results that you want. it also builds a

RE: Help with Sum(), newbie

2002-10-09 Thread Lucas Engelen
> mysql> select first, second, SUM(first) from example group by first; > +---+++ > | first | second | SUM(first) | > +---+++ > | 1 | 2 | 1 | > | 2 | 3 | 2 | > +---+++ > 2 rows in set (0.

Re: Help with Sum(), newbie

2002-10-09 Thread Terence
well the result is correct. the sum of first is 1 for the first record. the sum of first AND second would be 3. select first, second, sum(first + second) from example; is that what you want? Rgds Terence - Original Message - From: "Kevin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent