日期:2014-05-18  浏览次数:20512 次

选择列里包含时间列,MAX函数就失效了,为什么
select max(列2),列3 from table
 group by 列3
显示正确

 select dbo.Score.examDate,max(列2),列3 from table
 group by dbo.Score.examDate,列3

显示所有数据了。

 select convert(varchar(10),dbo.Score.examDate,102),max(列2),列3 from table
 group by convert(varchar(10),dbo.Score.examDate,102),列3

也不行。

不知道怎么解决?


------解决方案--------------------
SQL code
select max(dbo.Score.examDate) ,max(列2),列3 from table
 group by  列3