SELECT d.* FROM 201800522_article d,201800522_article_cate c WHERE c.id=d.cateId and c.tb=3 and c.lang = 'tw' and c.inuse='1' and d.tb='3' and d.lang = 'tw' and (d.inuse = '1' or (d.inuse ='2' and CONCAT(d.sdate, ' ', IFNULL(d.stime, '00:00:00')) <= '2024-07-13 23:37:36' and CONCAT(d.edate, ' ', IFNULL(d.etime, '23:59:59')) >='2024-07-13 23:37:36')) and d.cateId=5 order by d.seq desc