Table 'biznetwork.user_campaign_coupons' doesn't existselect c.id,c.category_name from categories c,user_campaign_coupons u,categories_reserved cr where u.user_id=cr.user_id and cr.category_id=c.id and u.coupon_type='smscoupon' and if(u.expired_status='0',u.expired_on>'2021-01-21 04:55:54',u.expired_on='') group by category_name Union select c.id,c.category_name from user_campaign_coupons u,categories c where c.category_name=u.biz_cat_name and u.coupon_type='bizteam' and u.expired_on>'2021-01-21 04:55:54' group by category_name