Live Ratings

Can't execute query

select lrm.liverating_id, lrm.rating_date, LTRIM(cl.client_name) as client_name, lrm.rating, cl.client_code, cl.city_id, cl.industry_id from liveratings_master as lrm inner join clients as cl on lrm.client_code = cl.client_code where lrm.isvisible = 1 and  lrm.liverating_id in (select lrd.liverating_id from liveratings_details as lrd where lrd.liverating_id = lrm.liverating_id) and cl.client_name <> '' order by rating_date desc,LTRIM(client_name)

MySQL Error:

This script cannot continue, terminating.