[thelist] Stuck on SQL

Fred Jones fredthejonester at gmail.com
Fri Jul 24 08:20:12 CDT 2009


> WHERE
>  civicrm_tag.name NOT LIKE "%Primary%" AND civicrm_tag.name NOT LIKE
> "%Secondary%"
> GROUP BY
>  civicrm_contact.id
>
> This should work in MySQL, not sure about PostgreSQL but I don't see why
> not.

It's MySQL but the problem is what if someone has two tags, on "Joe"
and one "Primary." He will be found by your query due to "Joe" but due
to "Primary" I actually do NOT want him.

F



More information about the thelist mailing list