Unknown column 'distance' in 'order clause':select * from sykes_jobs where isstaging = 0 and country = 'us' and country = 'us' and location = 'aberdeen,sd' and country = 'us' and location = 'aberdeen,sd' and category = 'customer service' order by case when workplace = 'WAH' then 1 else 0 end, -distance, rand_col desc limit 0, 50