SELECT * from (
SELECT productCategory_id as id , concat(code ,' - ',category )as text FROM tbl_productcategory
)tmp
where (text like '%{item_id}%'  or  '{item_id}'= '0')
order by text