I am trying to search for two keywords within the data table, but am running into issues where the following returns no resolutes even through I know there are about 36.
Can somebody help me write a better query?
SELECT user_id, name, value
FROM data
INNER JOIN fields ON data.field_id = fields.id
WHERE name IN ('Type', 'Category')
AND value = 'Keyword 1'
AND value = 'Keyword 2' /* If I use OR it returns 50 records of those +14 are irrelevant*/
GROUP BY user_id
HAVING COUNT(user_id)>1
ORDER BY value
Am I missing something?