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

[SQL] \COPY in psql using \e

2011-11-02 Thread Ivan Sergio Borgonovo
I'm connecting to a DB with psql -h host DB once in psql I'd like to \e create temp table t1 ...; \copy t1 from 'filename' ... select * from t1; [ESC]:x what I get is: CREATE TABLE ERROR: syntax error at or near "select" LINE 3: select * from t1; ^ \copy: ERROR: syntax error at or n