请看一下这个条件 mysql 查询:
SELECT attr1,attr2,attr3 FROM table
WHERE
( attr1 LIKE '%cond1%' OR attr1 LIKE '%cond2%' )
OR
( attr2 BETWEEN '30' AND '45' )
OR
( attr3 IN ('cond3') AND attr3 = 'cond4' AND attr3 BETWEEN '18' AND '30' )
ORDER BY CASE
WHEN ( attr1 LIKE '%cond1%' OR attr1 LIKE '%cond2%' ) THEN 1
WHEN ( attr2 BETWEEN '30' AND '45' ) THEN 2
ELSE 3
END
有没有办法用 mysql 和 php 获得每个条件返回的行数?还是处于租赁条件 3?
例如,我需要一种方法来知道条件 3 返回了 200 行并将此值存储到 php 变量中。