->orderByRaw('CASE isread WHEN 0 THEN 0 ELSE 1 END, last_message_time DESC')
ORDER BY FIELD(id, 100, 100500, 300), last_message_time
categories
id (PRIMARY)
title
parent_id
order
LIKE '%".$startFrom."%' ... LIMIT {$startFrom}, 100
LIKE '%101%' ... LIMIT 101, 100
-- или
LIKE '%learn sql%' ... LIMIT learn sql, 100</code