Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有下表:
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
我正在尝试获取出现两个或多个指定值的行数。例如,在上表中,26 和 1 出现在 3 行中。
在 mySQL 中是否有一种快速的方法来执行此操作,或者我应该在 PHP 中构建一些函数?
非常感谢您的帮助
SELECT COUNT(*) FROM your_table WHERE 1 IN (n1,n2,n3,n4,n5) AND 26 IN (n1,n2,n3,n4,n5)