Module: select main_newstool.nwst_id, main_newstool.nwst_date, main_newstool.nwst_heading from main_newstool inner join main_newstooltypes on main_newstooltypes.nwtt_id = main_newstool.nwtt_id inner join main_site on main_site.site_id = main_newstool.site_id left join main_portals_newstool on main_portals_newstool.nwst_id = main_newstool.nwst_id left join main_portals on main_portals.port_id = main_portals_newstool.port_id where (main_newstool.nwst_expires > "2013-05-24" or main_newstool.nwst_expires = "00000000" ) and main_newstool.nwst_valid <= "2013-05-25" and (main_portals.port_id = 10 or main_portals_newstool.nwst_id is null) and main_site.site_id = and main_newstooltypes.nwtt_id = 1 order by main_newstool.nwst_valid desc limit 0,5
83