I have the following table
id | data | reference_id
1 Jacob 3
2 Apples 3
3 Henry 4
4 Pie 4
5 Jacob 5
6 Pears 5
What I’m trying to do is build a query that checks if data exists in the same reference_id given the data.
So basically:
SELECT COUNT(*) WHERE data='Jacob' AND data='Apples' AND
...(reference_id's are the same)
1 Answer