首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

选择列里包含时间列,MAX函数就失效了,为什么解决办法

2012-04-07 
选择列里包含时间列,MAX函数就失效了,为什么select max(列2),列3 from tablegroup by 列3显示正确select d

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

热点排行