Unknown column 'distance' in 'order clause':select * from sykes_jobs where isstaging = 0 and ( city like '%Drummondville, Quebec, CA%' or address like '%Drummondville, Quebec, CA%' or state like '%Drummondville, Quebec, CA%' or title like '%Drummondville, Quebec, CA%' or location like '%Drummondville, Quebec, CA%' ) order by case when workplace = 'W@H' then 1 else 0 end, -distance, rand_col desc limit 0, 50