ROM a
WHERE v1/v2 > 1.5;
-- This one gives 'division by zero':
WITH T AS (
SELECT 1.0 AS v1, 0.0 AS v2
UNION ALL
SELECT 3.0, 1.0
UNION ALL
SELECT 2.0, 0.0
)
SELECT *
FROM (
SELECT *
FROM t
WHERE z(v2)
) AS a
WHERE v1/v2 > 1.5;
-
WBR, Yaroslav Schek
Hello,
OK
select 1 as ccc where 1=1
ERROR
select 1 as ccc where ccc=1
PostgreSQL said: ERROR: Attribute 'ccc' not found
Is there any way to set conditions on calculated fields values?
Best regards,
Yar
---(end of broadcast)---
TIP 3: if
Hello,
Sorry if it's wrong list for the question. Could you suggest some tweaks
to the PostgreSQL 7.2.1 to handle the following types of tables faster?
Here we have table stats with something over one millon records.
Obvious SELECT COUNT(*) FROM stats takes over 40 seconds to execute,
and
Christopher Kings-Lynne wrote:
Doing a row count requires a sequential scan in Postgres.
Try creating another summary table that just has one row and one column and
is an integer.
I have THREE summary tables derived from stats with different levels
of aggregation. They work quite fast,