Number of rows in which two or more specified values appear
mysql, sql
Solution
SELECT COUNT(*) FROM your_table
WHERE 1 IN (n1,n2,n3,n4,n5) AND 26 IN (n1,n2,n3,n4,n5)
Problem
I have the following table: ``` n1|n2|n3|n4|n5 1| 5| 4| 7|26 26|80|75| 1|10 5| 3| 2| 1|4 45|26| 1| 3|66 ``` I'm trying to get the number of rows in which two or more specified values appear. In the above table, for example, 26 and 1 appear in 3 rows. Is there a fast way to do this in mySQL or should I build some function in PHP? Thank you very much for your help