SELECT * FROM myact WHERE ( (status > 1 and status < 6) and (actID = 1 or actID = 1998 or actID = 2002)) order by actID, pro, enddate , tim desc, id desc limit $from,$step