MySQL query 'select offer_id from (select, c.offer_id coi, min(c.city_id) cci_min, min(left(c.dt, 10)) dtg_min, max(left(c.dt, 10)) dtg_max, count(distinct left(c.dt, 10)) dtg_cn, count( ci_cn, round(sum(oo.pay_price)) op_sum, round(sum(oo.pay_price)/count(distinct left(c.dt, 10))) pd from c, vgnew.offeropt oo, mk.offer_import oi, mk.offer o, mk.offerlist_76_1 l where = and o.alg_moderated > 0 and = and oi.import_id = c.offer_id and = c.offeropt_id and oo.pay_price > 0 group by coi order by dtg_max desc, cci_min asc, pd desc limit 200) t' failed: SELECT command denied to user 'mk'@'' for table 'coupon'