I want to know. Has anyone who accessed today accessed in the past? The number of people.
SELECT
COUNT(user_id) AS repeater_user_count
FROM
[access_log] AS table1
WHERE
_PARTITIONTIME = TIMESTAMP('2017-02-28')
AND
EXISTS
(
SELECT
1
FROM
[access_log] AS table2
WHERE
_PARTITIONTIME BETWEEN TIMESTAMP('2017-01-31') AND TIMESTAMP('2017-02-27')
AND
table1.user_id = table2.user_id
)
However, the BigQuery UI issues an error.
Error: error at: 8.1 - 13.184. Only one query can be executed at a time.
How can I refer to the same table by BigQuery?
thanks.
Make sure to enable standard SQL first. For example,
#standardSQL
SELECT
COUNT(user_id) AS repeater_user_count
FROM
`access_log` AS table1
WHERE
_PARTITIONTIME = '2017-02-28'
AND
EXISTS
(
SELECT
1
FROM
`access_log` AS table2
WHERE
_PARTITIONTIME BETWEEN '2017-01-31' AND '2017-02-27'
AND
table1.user_id = table2.user_id
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With