I am trying to make a query in MySQL, I have a table that contains the following:
id, ano, m1, m2, m3, m4, m5, m6, m7
10, 2016, I, P, L, I, L, P, I
That is, what I want to achieve is that you tell me when it is specifically the ano
and the id
, that is, the example only has data the ano
2016
and in the following example of query the I do the ano
2015
and it tells me anyway the I
in the table calf
query that I make:
SELECT id, COUNT(*) AS r
FROM 'calf'
WHERE ano='2015' AND id='10' AND m1='I' OR m2='I' OR m3='I' OR m4='I' OR m5='I' OR m6='I' OR m7='I'