Не красиво, но должно работать:
SELECT COUNT(*) FROM (
SELECT
t0.d_max
, IFNULL(t1.ps1,0) as ps1, IFNULL(t2.ps2,0) as ps2
, IFNULL(t3.ps3,0) as ps3, IFNULL(t4.ps4,0) as ps4
, IFNULL(t5.ps5,0) as ps5, IFNULL(t6.ps6,0) as ps6
, IFNULL(t7.ps7,0) as ps7, IFNULL(t8.ps8,0) as ps8
, IFNULL(t9.ps9,0) as ps9, IFNULL(t10.ps10,0) as ps10
FROM `table` t0
LEFT JOIN `table` t1 ON (t0.id = t1.id AND t1.ps1 BETWEEN 10 AND 20)
LEFT JOIN `table` t2 ON (t0.id = t2.id AND t2.ps2 BETWEEN 10 AND 20)
LEFT JOIN `table` t3 ON (t0.id = t3.id AND t3.ps3 BETWEEN 10 AND 20)
LEFT JOIN `table` t4 ON (t0.id = t4.id AND t4.ps4 BETWEEN 10 AND 20)
LEFT JOIN `table` t5 ON (t0.id = t5.id AND t5.ps5 BETWEEN 10 AND 20)
LEFT JOIN `table` t6 ON (t0.id = t6.id AND t6.ps6 BETWEEN 10 AND 20)
LEFT JOIN `table` t7 ON (t0.id = t7.id AND t7.ps7 BETWEEN 10 AND 20)
LEFT JOIN `table` t8 ON (t0.id = t8.id AND t8.ps8 BETWEEN 10 AND 20)
LEFT JOIN `table` t9 ON (t0.id = t9.id AND t9.ps9 BETWEEN 10 AND 20)
LEFT JOIN `table` t10 ON (t0.id = t10.id AND t10.ps10 BETWEEN 10 AND 20)
) s
WHERE s.d_max < GREATEST(s.ps1,s.ps2,s.ps3,s.ps4,s.ps5,s.ps6,s.ps7,s.ps8,s.ps9,s.ps10)
Обратите внимание, что для этой таблицы требуется явный первичный ключ, однако если вы используете InnoDB, вы всегда должны использовать явный PKили страдают от серьезных проблем с производительностью.
Редактировать
Проверьте, будет ли следующая конструкция быстрее ....
SELECT COUNT(*) FROM (
SELECT
d_max
,CASE WHEN ps1 BETWEEN 10 AND 20 THEN ps1 ELSE 0 END AS ps1
,...
,CASE WHEN ps10 BETWEEN .. AS ps10
) s
WHERE s.d_max < GREATEST(s.ps1,s.ps2,s.ps3,s.ps4,s.ps5,s.ps6,s.ps7,s.ps8,s.ps9,s.ps10)