groceries stats: quote day alias in shrinkflation query
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
This commit is contained in:
@@ -969,7 +969,7 @@ async function sizes(tx: Tx, scope: StatsScope, record: boolean) {
|
|||||||
from groceries.item_sizes s window w as (partition by s.item_id order by s.observed_on)
|
from groceries.item_sizes s window w as (partition by s.item_id order by s.observed_on)
|
||||||
)
|
)
|
||||||
select i.id, i.store_id s, i.name, s.size_text size, i.price_cents p, i.unit_price_cents up,
|
select i.id, i.store_id s, i.name, s.size_text size, i.price_cents p, i.unit_price_cents up,
|
||||||
i.unit, i.url, s.observed_on::text day, s.pa::float8 from_amount, s.unit_amount::float8 to_amount,
|
i.unit, i.url, s.observed_on::text as day, s.pa::float8 from_amount, s.unit_amount::float8 to_amount,
|
||||||
s.pp from_price, s.price_cents to_price
|
s.pp from_price, s.price_cents to_price
|
||||||
from s join groceries.items i on i.id = s.item_id
|
from s join groceries.items i on i.id = s.item_id
|
||||||
where s.pu = s.unit and s.unit_amount < s.pa * 0.99 and s.price_cents >= s.pp * 0.99
|
where s.pu = s.unit and s.unit_amount < s.pa * 0.99 and s.price_cents >= s.pp * 0.99
|
||||||
|
|||||||
Reference in New Issue
Block a user