 <p>Maybe ?:</p> <pre><code> SELECT * FROM `tbl_notes` WHERE `active` = '0' AND `valid_note` = '0' AND `user_id` = '33' AND (`note` LIKE '%biology%' OR `topic` LIKE '%biology%' OR `note_title` LIKE '%biology%' OR `course` IN (SELECT `id` FROM tbl_courses WHERE `course_name` LIKE '%biology%' AND user_id = '33') ) ORDER BY id DESC LIMIT 0, 6 </code></pre>