You probably already understood that. But here is one, and not the most effective way:
JOIN can only be performed using equality comparisons, i.e. b.id <= a.id cannot be used.
https://developers.google.com/bigquery/docs/query-reference#joins
It's pretty lame if you ask me. But there is one job. Just use equality comparison for some dummy value to get the Cartesian product, and then use WHERE for <=. This is insanely suboptimal. But if your tables are small, this will work.
SELECT a.id, SUM(a.value) as rt FROM RunTotalTestData a JOIN RunTotalTestData b ON a.dummy = b.dummy WHERE b.id <= a.id GROUP BY a.id ORDER BY rt
You can also manually limit the time:
SELECT a.id, SUM(a.value) as rt FROM ( SELECT id, timestamp RunTotalTestData WHERE timestamp >= foo AND timestamp < bar ) AS a JOIN ( SELECT id, timestamp, value RunTotalTestData WHERE timestamp >= foo AND timestamp < bar ) b ON a.dummy = b.dummy WHERE b.id <= a.id GROUP BY a.id ORDER BY rt
Update:
You do not need a special property. You can just use
SELECT 1 AS one
and join this.
As billing moves to the connection table in processing.
source share