[SQL] Distinct oddity

2009-05-07 Thread Maximilian Tyrtania
Hi there, does this look right? FAKDB=# select count(distinct(f.land)) from firmen f where f.typlist='Redaktion'; count --- 1975 (1 row) FAKDB=# select count(distinct(f.land||'1')) from firmen f where f.typlist='Redaktion'; count --- 4944 (1 row) FAKDB=# select version();

Re: [SQL] ask about epoch query with datetime

2009-05-07 Thread Ian Barwick
2009/5/7 haries fajar nugroho harie...@gmail.com: Hi All, my institution wants me to migrate from old postgresql to new postgresql, but when i test one of the query it failed at query : select date_part('epoch',datetime('2009-04-20 17:08:01')-datetime('2009-04-20 17:04:24'))::int; that

[SQL] select regexp_matches('a a a', '([a-z]) a','g');

2009-05-07 Thread Marc Mamin
Hello, I wonder if someone has an idea for this problem: I have a string that contains a serie of chars, separated by single spaces. e.g 'a b x n r a b c b' Having such a string, I d'like to get a list of all predecessors of a given character. In the example, the predecessors of b are a,a,c.

Re: [SQL] Distinct oddity

2009-05-07 Thread Scott Marlowe
On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania maximilian.tyrta...@onlinehome.de wrote: Hi there, does this look right? FAKDB=# select count(distinct(f.land)) from firmen f where f.typlist='Redaktion';  count ---  1975 (1 row) FAKDB=# select count(distinct(f.land||'1')) from

[SQL] select regexp_matches('a a a', '([a-z]) a','g');

2009-05-07 Thread Craig Ringer
First: Please don't reply to an existing message to create a new thread. Your mail client copies the replied-to message ID into the References: header, and well-implemented mail clients will thread your message under a now-unrelated thread. Compose a new message instead. Marc Mamin wrote: I