0
votes

What is the correct syntax for the following query in bigquery? SELECT COUNT(children.names) WITHIN RECORD AS numberOfChildren FROM [dataset.tableId] where numberOfChildren > 10;

1

1 Answers

1
votes

Try adding a subselect and applying the filter to the outer select:

SELECT numberOfChildren FROM (
   SELECT COUNT(children.names) WITHIN RECORD AS numberOfChildren 
   FROM [dataset.tableId]
) 
WHERE numberOfChildren > 10;