Files
2026-03-02 13:55:32 +00:00

13 lines
605 B
SQL

-- Rewritten BETWEEN 0.06 - 0.01 AND 0.06 + 0.01
-- to BETWEEN 0.06::Decimal(12,2) - 0.01::Decimal(12,2) AND 0.06::Decimal(12,2) + 0.01::Decimal(12,2)
-- because ClickHouse would parse them as floats by default.
-- Corresponding issue: https://github.com/ClickHouse/ClickHouse/issues/70136.
SELECT
sum(l_extendedprice * l_discount) AS revenue
FROM lineitem
WHERE (l_shipdate >= date '1994-01-01')
AND (l_shipdate < date '1994-01-01' + INTERVAL 1 YEAR)
AND (l_discount BETWEEN 0.06::Decimal(12,2) - 0.01::Decimal(12,2) AND 0.06::Decimal(12,2) + 0.01::Decimal(12,2))
AND (l_quantity < 24);