Look at my table below, I am trying to count the A in the table. A will only appear in one row, but sometime will be in the first column, sometime will be in other column, so I use OR, but it echo a number larger than 3, I only have 3 A, why? How can I only count 3 A?
"SELECT COUNT(*) FROM $table WHERE first='A' OR second='A' OR third='A' AND number <= 7"
id first second third number
1 A C B 3
2 C d F 5
3 A c b 6
4 B A c 7
WHERE (first='A' OR second='A' OR third='A') AND number <= 7'A' IN (first, second, third)?Acomes twice or more in single row?