select t.video_id from tbl_videos as t  join tbl_video_theme_subtheme_mapping as  sb on (t.video_id = sb.video_id)  join tbl_themes as  th on (th.theme_id = sb.theme_id)  join tbl_video_tag_mapping as  vtm on (vtm.video_id = t.video_id)  join tbl_tags as  tt on (tt.tag_id = vtm.tag_id) left join tbl_sub_themes as  st on (st.sub_theme_id = sb.sub_theme_id) left join tbl_video_country_location_mapping as  tclm on (tclm.video_id = t.video_id)  join tbl_country_location as  tcl on (tcl.country_location_id = tclm.country_location_id)  join countries as  tc on (tc.country_id = tcl.country_id)  where  1=1  && (th.theme_name REGEXP '[[:<:]]Coal Mine[[:>:]]' OR st.sub_theme_name REGEXP '[[:<:]]Coal Mine[[:>:]]' OR t.video_title REGEXP '[[:<:]]Coal Mine[[:>:]]' OR t.reel_number REGEXP '[[:<:]]Coal Mine[[:>:]]' OR tt.tag_name REGEXP '[[:<:]]Coal Mine[[:>:]]'  )  group by t.video_id22,299,306,1046,1285,1287,1289,1290,1292,1293,1689,1795,1985,2459,2468,2833,2840,3077,3089,3594,3841,4671,4711,4730,4953,6503,6808,6815,7321,7370,7373,7377,7473,8305,8380,8567,8627,8680,8865,8941,8951,9048,9512,9725,9729,9774,10457,10751,10836,11343,11389,11522,11555,11740,11830,11832,11891,12285,12766,12822,13826,14161,14257,14806,14807,14815,15055,15086,15488,15805,15868,15890,15918,16015,16442,17122,17632,17870,18001,18222,18390,18427,18501,18616,18697,18716,19260,20527