select pid,* from v_RolseFolw as a where a.StateValue>1 and not exists( select 1 from v_RolseFolw where a.mid = mid and a.userid=userid and StateValue>1 and a.StateValue>StateValue ) and UserID ='19'
select pid,* from v_RolseFolw as a where a.StateValue>1 and not exists( select 1 from v_RolseFolw where a.mid = mid and a.userid=userid and StateValue>1 and a.StateValue>StateValue ) and UserID ='19'