select * from ( select TOP ( SELECT COUNT(1) from S_Pub_Message M inner join S_Pub_User U on U.ID = M.SendUserID where M.Flag='1' and Status='1' ) M.*,U.CName from S_Pub_Message M inner join S_Pub_User U on U.ID = M.SendUserID where M.Flag='1' and Status='1' ORDER BY ID DESC ) a union all select * from ( select TOP ( SELECT COUNT(1) from S_Pub_Message M inner join S_Pub_User U on U.ID = M.SendUserID where M.Flag='1' and Status<>'1' ) M.*,U.CName from S_Pub_Message M inner join S_Pub_User U on U.ID = M.SendUserID where M.Flag='1' and Status<>'1' ORDER BY ID DESC ) b