Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on We Can Do Better Than SQL. Parent comment
Absolutely!
WITH april := <datetime>'2020-04-01T00:00+00', NewCustomers := ( SELECT Customer FILTER NOT EXISTS ( SELECT .orders FILTER .date < april ) ), AprilCustomers := ( SELECT Customer FILTER datetime_truncate(.orders.date, 'months') = april ), NewAprilCustomers := ( SELECT AprilCustomers FILTER AprilCustomers IN NewCustomers ) SELECT (count(NewAprilCustomers) / count(AprilCustomers)) * 100;
type Order_ { property date -> datetime; } type Customer { multi link orders -> Order_; }
Absolutely!
This assumes the following schema: