select a.*,
b.CodeTestingStatus as newstatus,
b.DataDate as newdate
from tblAppInventory a
inner join (
select
CodeTestingStatus,
DataDate,
appid
from tblAppInventory
order by DataDate asc) b
on a.AppID = b.AppID and b.DataDate > a.DataDate and a.CodeTestingStatus <>...