CT b.*      , a.*    FROM engine0_blog_blogs b   LEFT    JOIN engine0_authorization_allow a     ON a.resource_id = b.blog_id   WHERE a.resource_type = 'blog'    AND a.role NOT IN ('everyone')    AND a.action = 'view'    AND b.draft = 0    AND b.search = 0  ORDER      BY b.creation_date DESC