Re: [SQL] datestyle on windows environment: how to set?

2006-06-03 Thread Tom Lane
"filippo" <[EMAIL PROTECTED]> writes: > I'd like to have > DD-MM- for my timestamp field. The closest display format to that is 'SQL, DMY': regression=# set datestyle = 'sql, dmy'; SET regression=# select current_date; date 03/06/2006 (1 row) See the discussion of dates

[SQL] datestyle on windows environment: how to set?

2006-06-03 Thread filippo
Hello, I want to set the datestyle = 'ISO, European' for all my databases. I put that configuration into postgresql.conf file, but I didn't succeed. After rebooting all dates are like that: -MM-DD I'd like to have DD-MM- for my timestamp field. I have the latest version of pgsql and pe

[SQL] Fwd: Stalled post to pgsql-sql

2006-06-03 Thread Aaron Bono
I think this approach will only work if each broadcast_id has the same maximum date_sent value. You really need to do the group by in a sub-query to bring the broadcast_id together with the max date_sent. -Aaron Bono On 6/1/06, Yasir Malik <[EMAIL PROTECTED]> wrote: > What I would like to do i

Re: [SQL] Am I crazy or is this SQL not possible

2006-06-03 Thread Aaron Bono
I think this approach will only work if each broadcast_id has the same maximum date_sent value. You really need to do the group by in a sub-query to bring the broadcast_id together with the max date_sent. On 6/1/06, Yasir Malik <[EMAIL PROTECTED]> wrote: > What I would like to do is simply get

Re: [SQL] Am I crazy or is this SQL not possible

2006-06-03 Thread Aaron Bono
This reminds me of an interview question: I was asked how to get a maximum column from a table without using max. How would you do that? Select my_column from my_table order by my_column desc limit 1 -- == Aaron Bono President

Re: [SQL] Am I crazy or is this SQL not possible

2006-06-03 Thread maTKO
"Collin Peters" wrote: > DISTINCT also doesn't work > > SELECT DISTINCT ON (email_broadcast_id) * > FROM email_broadcast_history > ORDER BY date_sent > > As you have to have the DISTINCT fields matching the ORDER BY fields. > I have to ORDER BY date_sent, but I can't do a DISTINCT on date_sent DIS

Re: [SQL] distinct aggregate with complex type dont see the equality operator [solved]

2006-06-03 Thread Thomas Chille
using DISTINCT with complex types depends on an OPERATOR CLASS for B-Tree-Indexes i found out. the error msg 'could not identify an equality operator for type' was confusing. i post this complete example. maybe someone else is running in this problem too. regards, thomas! CREATE TYPE named_va

[SQL] distinct aggregate with complex type dont see the equality operator

2006-06-03 Thread Thomas Chille
Dear List, i want to built an aggregate function wich should summing up values in a distinct manner: dsum(DISTINCT ROW(value, distinction)). I implemented all things i thought i need but it dont work. i get always an 'could not identify an equality operator for type dsum_type'-error nevertheles

[SQL] Get max value from an comma separated string

2006-06-03 Thread Mauro Bertoli
Hi, I've a field that contain values-comma-separated like A) 1;2;3;;5 -- ;2;;4;5 but also B) 12;34;18 how I can get the max value? For A I tried: SELECT max(array_upper(string_to_array(answer,';'),1)) FROM values; and work fine, but for B case I don't find a solution like SELECT max(string_to_arra