mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-27 04:54:21 +01:00
this causes sqlite and tursodb to interpret the value as just 'yyyy', e.g. '1995-01-01' becomes '1995', causing a lot of the queries not to return any results, which is not what we want.
14 lines
360 B
SQL
14 lines
360 B
SQL
select
|
|
100.00 * sum(cast(case
|
|
when p_type like 'PROMO%'
|
|
then l_extendedprice * (1 - l_discount)
|
|
else 0
|
|
end as number)) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
|
|
from
|
|
lineitem,
|
|
part
|
|
where
|
|
l_partkey = p_partkey
|
|
and l_shipdate >= '1994-03-01'
|
|
and l_shipdate < '1994-04-01'; -- modified not to include cast({'month': 1} as interval)
|