One problem with removing justify_hours() is that this is going to
return '24:00:00', rather than '1 day:
test=> select '2004-01-02 00:00:00'::timestamptz - '2004-01-01
00:00:00'::timestamptz;
?column?
--
24:00:00
(1 row)
This is a temporary table (with no indexes) that gets created in the same
transaction block as the SELECT gets run, but I tried creating an index on
the ean column anyway with no luck:
CREATE INDEX ean_idx ON TMPTABLE USING btree (ean);
SELECT DISTINCT ON (ean)
ean,
count(*)
FROM
Yes, it is confusing. I have an update to the array documentation that
should clarify it --- attached.
---
Achilleas Mantzios wrote:
> ? 16 ??? 2007 20:35, ?/? chrisj ??:
> > I am quite sure the [2]
Dnia Tue, 20 Feb 2007 15:36:32 +1100, Phillip Smith napisał(a):
> Removing the CASE statement all together:
> SELECT DISTINCT ON (ean)
> ean,
> count(*)
> FROMTMPTABLE
> WHERE code NOT IN (SELECT code FROM stock_deleted)
> ANDean IS NOT NULL
> GROUP BY ean
>
> Still gi