From 6543f31acb6566cd6a79469d15d9812407d30841 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 7 Sep 2020 01:57:43 +0100 Subject: [PATCH] fix sql query to only consider vending shops --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36122ae..9fb8845 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,8 @@ SELECT shops.title, items.name, shop_items.price, items.item_id, LEFT JOIN shop_snapshots ON shop_snapshots.shop_id=shops.id LEFT JOIN shop_items ON shop_items.snapshot_id=shop_snapshots.id LEFT JOIN items ON shop_items.item_id=items.id - WHERE shop_snapshots.last_seen_date=(SELECT MAX(last_seen_date) FROM shop_snapshots) + WHERE shops.type=1 AND + shop_snapshots.last_seen_date=(SELECT max(last_seen_date) FROM shop_snapshots) ) GROUP BY item_id ``` @@ -89,4 +90,4 @@ This returns an estimate in MiB of the total storage occupied by the saved JSON ``` SELECT SUM(LENGTH(source))/1024/1024 FROM source_store -``` \ No newline at end of file +```