SELECT DISTINCT a.`id` AS `id`, `user_id`, `lower_user_id`, `display_name`, `email`, `last_login`, `creation_time`, `backend`, `state`, `quota`, `home` FROM `oc_accounts` a LEFT JOIN `oc_account_terms` t ON a.`id` = t.`account_id` WHERE (`lower_user_id` LIKE '%%') OR (`display_name`  COLLATE utf8mb4_general_ci LIKE '%%') OR (`email`  COLLATE utf8mb4_general_ci LIKE '%%') OR (t.`term` LIKE '%%') ORDER BY `user_id` ASC LIMIT 200