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