读书人

选择列里包含时间列MAX函数就失效了

发布时间: 2012-04-07 17:31:52 作者: rapoo

选择列里包含时间列,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 

读书人网 >SQL Server

热点推荐