SELECT * FROM my_business AS t1 LEFT JOIN my_category AS t2 ON (t1.id = t2.primary_category) OR (t1.id = t2.secondary_category) WHERE t2.uri_node = $cat ORDER BY name $sort LIMIT $offset, $limit