I have procedure "CheckStatus" which returns 0 or 1. How I can use this query without HAVING? It's not work properly with limit 0,10 - it filtering rows with status=0 and I never got 10 results as I expected. Yes I understand that HAVING w/o GROUP BY just filtering results and not rows.
How I can use status in WHERE?
select id,CheckStatus(stock,delivery_days) as `status` from new where
id in ('52078','52093','52095','81584','81589')
having status in ('1')
order by field (id,'52078','52093','52095','81584','81589') group by id limit 0,10
Also maybe I can someway create generated column with this procedure? I tried to add it but got an error about I can't call procedure for generated columns.