select * from PD_ReCode a where not exists
(select * from PD_ReCode b where a.ChuangKou=b.ChuangKou and a.Time_Call<b.Time_Call )
and IS_Call=1 and DATEDIFF(dd,RiQi,GETDATE())=0
order by a.ChuangKou
(select * from PD_ReCode b where a.ChuangKou=b.ChuangKou and a.Time_Call<b.Time_Call )
and IS_Call=1 and DATEDIFF(dd,RiQi,GETDATE())=0
order by a.ChuangKou