You only need 1 query field. You'll just concat the results and then use a REGEX operator then some regex to match a specific group. Example as follows.
Query:
Code:
SELECT GROUP_CONCAT( `id` SEPARATOR '\n' )
FROM `#__groupjive_groups`
WHERE `user_id` = '[user_id]'
GROUP BY `user_id`
The above should give you a linebreak separated (much easier to match than comma list) list of group ids. Example results as follows.
1
10
21
31
41
51
61
100
You'd then configure your conditionals as follows. Note it's important to test your query field gives the expected results. Be sure to test it on profile view to ensure it is linebreak separated before moving forward or the REGEX will not work right.
Field: Custom > Value
Value: [cb_myqueryfield]
Operator: Is REGEX
Value: /^DIGIT_HERE$/ or /DIGIT_HERE\s/
Mode: Show
Replacing DIGIT_HERE with 10 for example should match the above as 10 exists in the list. I've provided 2 REGEX you can try in the above encase one doesn't work as expected.