Does not contain

4,956 views
Skip to first unread message

JKWA

unread,
Apr 5, 2012, 7:13:57 PM4/5/12
to bigquery...@googlegroups.com
I need to perform a query similar to below

SELECT GROUP_CONCAT(foo), bar
FROM table
GROUP BY bar
HAVING GROUP_CONCAT(foo) DOES NOT CONTAIN "string";


I've looked at using a regular expression but have so far come up empty.  

Any suggestions?

Joe

Siddartha Naidu

unread,
Apr 5, 2012, 7:37:37 PM4/5/12
to bigquery...@googlegroups.com
Is this what you are looking for:

SELECT bar, GROUP_CONCAT(foo) list FROM table
GROUP BY bar HAVING NOT(list CONTAINS "string");

JKWA

unread,
Apr 5, 2012, 8:10:49 PM4/5/12
to bigquery...@googlegroups.com
Ahh, I see now.

I had this:
HAVING COUNT(foo) > 2 NOT list CONTAINS "string" 

But needed to write this:
HAVING COUNT(foo) > 2 AND NOT list CONTAINS "string"  


Thanks for the help Siddarth.
Reply all
Reply to author
Forward
0 new messages