I'm trying to create a temp table in BigQuery, something like:
CREATE TEMP TABLE myTmpTable AS
SELECT t.event_id, MAX(t.event_date)
FROM eventsTable t
WHERE t.field_name = "foo"
AND t.new_string = "bar"
GROUP BY t.event_id;
This results in error "CREATE TABLE columns must be named, but column 2 has no name". I understand that it can't extract a column name from MAX(t.event_date). Is there a way I can specify a column name?