Changed join to price table to a LEFT JOIN so that I can also keep track of the Alamo restaurant operating hours with the same tables

This commit is contained in:
wes
2024-05-20 13:35:46 -04:00
parent 0ce13cf8a4
commit 1678a2f5a6
4 changed files with 88 additions and 1 deletions
+3
View File
@@ -42,8 +42,11 @@ SELECT livedata.time_stamp
,restriction_summary
--FROM knoebels."LZ_attractions_io" AS livedata
FROM livedata
--This POI data comes from a massive JSON file hosted by attractions.io the app downloads it on first launch. Not sure how often it's updated or only as-needed
JOIN knoebels."LZ_attractions_io_poi" AS poi ON livedata._id = poi._id
-- This is my own "master" file for ride data, for data points not served by the attractions.io API. Handstamp inclusions/exclusions, capacity, duration, etc.
JOIN knoebels.ride_master rm ON livedata._id = rm.attractions_dot_io_id
-- fetch most recent price data, scraped from webpage, this can differ from the POI data used by the app
JOIN (SELECT row_number() OVER (PARTITION BY ride ORDER BY time_stamp DESC) AS row_number, * FROM knoebels.ride_data_in) prices ON prices.ride = rm.ride and prices.row_number = 1
--ORDER BY name, time_stamp
--where name = 'Sklooosh'