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