1
votes

I'm trying to run the following query but consistently getting an 'Error: unexpected. Please try again':

select sum( ssw.stem_count ) as sum_stem_count, ssw.stem, min( ssw.term )
from ( select * from mediacloud.ssw_2011_11_14_2011_11_20, mediacloud.ssw_2011_11_21_2011_11_27 )
    as ssw left join mediacloud.topic_obama as ssw_q
    on ssw.stories_id = ssw_q.stories_id 
  group by ssw.stem order by sum_stem_count desc limit 1000;

The following query works fine:

select sum( ssw.stem_count ) as sum_stem_count, ssw.stem, min( ssw.term )
  from mediacloud.ssw_2011_11_14_2011_11_20 as ssw 
      left join mediacloud.topic_obama as ssw_q
    on ssw.stories_id = ssw_q.stories_id 
  group by ssw.stem order by sum_stem_count desc limit 1000;

The docs seems to say that subqueries can be used as entries in the from clause, but I can't get this to work. What am I doing wrong?

1

1 Answers

0
votes

You may have hit the same issue as here: if clause in bigquery (I realize no if clause is involved, but it looks to be related). We're actively investigating and hope to have a resolution later today.