I received a few irrelevant results to my count that I would like to remove from my output.
When using only the first "where lower (person) not like '%c%'" worked but when adding person b, c etc. as shown it gave me the original irrelevant results.
What should I change?
SELECT
person,
COUNT(1) AS count_mentions,
COUNT(DISTINCT url) AS count_distinct_urls
FROM
project.dataset.keyword
WHERE
LOWER(person) NOT LIKE '%b%'
OR LOWER(person) NOT LIKE '%c%'
OR LOWER(person) NOT LIKE '%e%'
OR LOWER(person) NOT LIKE '%f%'
GROUP BY
person
ORDER BY
count_mentions DESC
LIMIT
5;
Expected results:
Row person count_mentions count_distinct_urls
-----------------------------------------------
1 a --- ----
2 d
3 g
4 h
5 i
See Question&Answers more detail:os