Query help - Joining adjacent rows?

2005-06-21 Thread comex
I have a table: create table example(time datetime, username varchar(255)); timeusername 2005-06-21 15:58:02 user1 2005-06-21 14:58:02 user1 2005-06-21 11:57:51 user2 2005-06-21 10:57:51 user1 2005-06-21 09:57:51 user1 The query: select COUNT(*), username, MAX(time) as

Re: Query help - Joining adjacent rows?

2005-06-21 Thread Mihail Manolov
Will this work? GROUP BY maxtime, user ORDER BY maxtime DESC comex wrote: I have a table: create table example(time datetime, username varchar(255)); timeusername 2005-06-21 15:58:02 user1 2005-06-21 14:58:02 user1 2005-06-21 11:57:51 user2 2005-06-21 10:57:51 user1

Re: Query help - Joining adjacent rows?

2005-06-21 Thread SGreen
comex [EMAIL PROTECTED] wrote on 06/21/2005 11:07:35 AM: I have a table: create table example(time datetime, username varchar(255)); timeusername 2005-06-21 15:58:02 user1 2005-06-21 14:58:02 user1 2005-06-21 11:57:51 user2 2005-06-21 10:57:51 user1 2005-06-21

Re: Query help - Joining adjacent rows?

2005-06-21 Thread comex
Basically it boils down to the fact that with SQL you have to use some other way of telling each group apart other than position (or interposition, as you say in your example). The fact that you have entries in your table from user1, user1, user2, user1, user2, user3, and user1 doesn't

Re: Query help - Joining adjacent rows?

2005-06-21 Thread SGreen
comex [EMAIL PROTECTED] wrote on 06/21/2005 12:46:00 PM: Basically it boils down to the fact that with SQL you have to use some other way of telling each group apart other than position (or interposition, as you say in your example). The fact that you have entries in your table from

Re: Query help - Joining adjacent rows?

2005-06-21 Thread comex
How would you like to see that information GROUPed and what does that grouping represent (physically). In essence, I am asking you to describe what information you are determining by the grouping process, what does each GROUP mean to you? Grouping just means that somebody visited twice in a

Re: Query help - Joining adjacent rows?

2005-06-21 Thread Jochem van Dieten
On 6/21/05, comex wrote: I have a table: create table example(time datetime, username varchar(255)); Please tell me you didn't actualy use time as identifier :) timeusername 2005-06-21 15:58:02 user1 2005-06-21 14:58:02 user1 2005-06-21 11:57:51 user2 2005-06-21 10:57:51