2006 20:56
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: SELECT...GROUP BY WITHIN GROUP BY
I'm not sure that this is exactly what you want, but I think you can use
the WITH ROLLUP modifier:
select district, town, street, surname, count(surname)
from test5
group by distric
Kerry
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 28 November 2006 20:56
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: SELECT...GROUP BY WITHIN GROUP BY
I'm not sure that this is exactly what you want, but I think you can use
the WITH ROLLU
I'm not sure that this is exactly what you want, but I think you can use
the WITH ROLLUP modifier:
select district, town, street, surname, count(surname)
from test5
group by district asc, town asc, street asc, surname asc WITH ROLLUP
Here's a link to the MySQL documentation on WITH ROLLUP
http:
mailto:[EMAIL PROTECTED]
Sent: Monday, 8 March 2004 14:03
To: Darran Kartaschew; [EMAIL PROTECTED]
Subject: Re: SELECT ... GROUP BY
You need to do this in 2 steps.
Step 1:
select user_id, max(last_updated) as max_last_updated from posts group by user_id
You probably need to do this into a tem
Excellent, that worked...
Yours Sincerely
Darran
-Original Message-
From: Daniel Kasak [mailto:[EMAIL PROTECTED]
Sent: Monday, 8 March 2004 14:03
To: Darran Kartaschew; [EMAIL PROTECTED]
Subject: Re: SELECT ... GROUP BY
You need to do this in 2 steps.
Step 1:
select user_id, max
MySQL the proper place to do this stuff...
Darran
-Original Message-
From: Donny Simonton
Sent: Monday, 8 March 2004 13:49
To: Darran Kartaschew; [EMAIL PROTECTED]
Subject: RE: SELECT ... GROUP BY
You should change it to something like this:
Select * from posts group by user_id ord
Darran Kartaschew wrote:
Warning: SQL newbie...
I'm trying to create a query where the most recent entry for each user is returned from a forum table, and sorted by username. The fields are simply: user_id, username, post, last_updated. No primary key defined.
I've tried the simple "SELECT
You should change it to something like this:
Select * from posts group by user_id order by username, timestamp DESC
That should give you the last post.
Donny
> -Original Message-
> From: Darran Kartaschew [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 07, 2004 9:42 PM
> To: [EMAIL PROT