BigQuery Absolutely puzzled with this Bigquery result
I have this query in Bigquery:
SELECT column1, column2, count(*)
FROM table
GROUP BY column1, column2
HAVING COUNT(*) >
1When I run it, I get no data as a result, so no duplicates in the table.
However, if I run this
SELECT count(*)
FROM (
SELECT column1, column2, count(*)
FROM table
GROUP BY column1, column2
HAVING COUNT(*) >
1
)The result is 470548, meaning every single row in the table. Why? I would expect to get 0 or null, since the subquery has no result at all.
13
Upvotes
View all comments
Show parent comment
0
u/JLTDE May 28 '26
100% sure is the same code. I was actually running the subquery in the UI by selecting my query partially