SELECT quote, movie_id, character_id, slug from quotes INNER JOIN quotes_categories on quotes_categories.quote_id = quotes.id where category = '' order by case when (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(quote, '...', ''), '..', ''), '.', ''), '!', ''), "'", ''), '"', ''), '%', ''), '*', ''), '(', ''), ')', ''), '@', ''), '%', ''), '$', ''), '#', ''), ' ' , ''), '-', ''), '_', '') = '') then 1 else 2 end limit 0, 8