mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
13 lines
605 B
SQL
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);
|