Re: [SQL] Number timestamped rows

2011-11-08 Thread Jasen Betts
On 2011-11-02, Jan Peters wrote: > Dear all, > maybe a stupid question, but: I have a table that is ordered like this: > Tables aren't ordered. Sometimes they may seem to be ordered, but they seldom stay that way for long. > and I would like to number them according to their timestamps like th

Re: [SQL] Number timestamped rows

2011-11-02 Thread Andreas Kretschmer
Jan Peters wrote: > Dear all, > maybe a stupid question, but: I have a table that is ordered like this: > > user_id|timestamp|event > 1 |0:1 |event_a > 1 |0:2 |event_b > 2 |0:1 |event_b > 2 |0:3 |event_c > 2 |0:4 |event_b > 3 |0:1 |even

[SQL] Number timestamped rows

2011-11-02 Thread Jan Peters
Dear all, maybe a stupid question, but: I have a table that is ordered like this: user_id|timestamp|event 1 |0:1 |event_a 1 |0:2 |event_b 2 |0:1 |event_b 2 |0:3 |event_c 2 |0:4 |event_b 3 |0:1 |event_a and I would like to number them acc