linfo2172-databases/P3/queries/query7.sql

8 lines
295 B
SQL

-- Determine the identifiers of purchases performed in Brabant on the last day present in the database.
SELECT Purchases.id AS ids
FROM Purchases
JOIN province ON province.ROWID = Purchases.province
WHERE time > date((SELECT MAX(time) FROM Purchases),'-1 days') AND province.name = 'Brabant'
;