[SQL] Creating an aggregate function

2000-09-09 Thread Roberto Mello
Hi all, This e-mail is long because I am providing lots of details on the problem. It's an OpenACS module that we are porting so it'll have lots of users, you can be sure. I have this view that I am porting that is a UNION of two self OUTER JOINed views. PG does not support UNIONs in views, so

Re: [SQL] Creating an aggregate function

2000-09-09 Thread Tom Lane
Roberto Mello <[EMAIL PROTECTED]> writes: > and our output was: > date_id | n_sessions_day | members | non_members > -++---+- > 1 |500 |30 | 136394044 > 2 | 2000 | 136394612 | 136394

Re: [SQL] Porting from mysql to psql (UNIX_TIMESTAMP()?)

2000-09-09 Thread Tom Lane
Zlatko Calusic <[EMAIL PROTECTED]> writes: > Is there any similar functionality (returning unixish number of > seconds since 1970 from the timestamp field) in PostgreSQL? Sure. You can use date_part, or cast to abstime and thence to integer: regression=# select now(); now

[SQL] Porting from mysql to psql (UNIX_TIMESTAMP()?)

2000-09-09 Thread Zlatko Calusic
Hi! As subject says, we are currently porting all of our data, programs and logic from mysql to postgresql. One of the things we have yet to resolve is how to replace mysql's UNIX_TIMESTAMP() function we used extensively in PosgreSQL? Function works like this in mysql: mysql> select start from

[SQL] Re: [GENERAL] Porting from mysql to psql (UNIX_TIMESTAMP()?)

2000-09-09 Thread Zlatko Calusic
Zlatko Calusic <[EMAIL PROTECTED]> writes: > Is there any similar functionality (returning unixish number of > seconds since 1970 from the timestamp field) in PostgreSQL? It's amazing that I spent something like an hour trying to find an answer, and only ten minutes waiting for the answer to it.