除了上面的问题,我想知道是否有任何方法可以优化这个 MySQL 语句。
SELECT *
FROM `products`
WHERE
`category` = 3073 OR
`category` = 3074 OR
`category` = 3100 OR
`category` = 3102 OR
`category` = 3106 OR
`category` = 3109 OR
`category` = 3111 OR
`category` = 3115 OR
`category` = 3130 OR
`category` = 3134 OR
`category` = 3144 OR
`category` = 3146 OR
`category` = 3152 OR
`category` = 3157 OR
`category` = 3162 OR
`category` = 3163 OR
`category` = 3164 OR
`category` = 3166 OR
`category` = 3167 OR
`category` = 3168 OR
`category` = 3170 OR
`category` = 3171 OR
`category` = 3177 OR
`category` = 3181 OR
`category` = 3182 OR
`category` = 3184 OR
`category` = 3190 OR
`category` = 3191 OR
`category` = 3192 OR
`category` = 3213 OR
`category` = 3224 OR
`category` = 3227 OR
`category` = 3228 OR
`category` = 3235 OR
`category` = 3238 OR
`category` = 3239 OR
`category` = 3240 OR
`category` = 3244 OR
`category` = 3245 OR
`category` = 3246 AND
`active` = 1 AND
`price_notax` > 0 AND
`deleted` = 0
ORDER BY `position` ASC
LIMIT 0, 24;
该语句还显示字段值为price_notax
equal的产品0
,为什么?我说这个数字需要高于0
...
任何帮助,将不胜感激。