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