1、獲取形同時間的最大數
select a.mobile,a.calltime,a.timelong
From test003 a
Where a.timelong=
(select max(timelong) from test003 b where a.mobile=b.mobile and convert(varchar(20),a.calltime,120)=
(select max(convert(varchar(20),c.calltime,120)) from test003 c where c.mobile=a.mobile ))
--group by a.mobile having count(a.mobile)>1
order by a.timelong desc
2、查詢內容爲NULL的字段
select * from test_table where stu_num is NULL
修改爲空
update test_table set stu_num=' ' where stu_num is NULL