在数据庫中,两个字段,时间。手机号码,号码有重复,取每个号码最早的时间 select 手机号码,max(时间) as 时间 from 表 group by 手机号码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @t table(number varchar(20),dt datetime)insert into @tselect '13966759391', '2005-11-17 10:39:50.217' unionselect '13966759391', '2005-11-17 10:40:10.077' unionselect '13966759391', '2005-11-17 10:40:11.327' unionselect '13966759391', '2005-11-17 10:40:12.327' unionselect '13900000000', '2005-11-17 10:40:21.590' unionselect '13900000000', '2005-11-17 10:40:28.250' unionselect '13900000000', '2005-11-17 10:40:29.483'select number,min(dt) from @t group by number结果13900000000 2005-11-17 10:40:21.59013966759391 2005-11-17 10:39:50.217 求最小依赖集,有两个答案,请指点哪个是正确的或者都可 数据库的安全 求一SOL? sql2000读取数据 一个关于触发器的问题 如何使.25678899这个数值前面加上0,并且四舍五入。。最终查询结果为0.26 没学过数据库可不可以学习SQL,介绍几本最基本的书好不好? 为何在vb中,用记录集调不出存储过程中的临时表?高手提个建议。 请教一个SQL问题??? 初学者的学习-5-->自由的大小写不敏感 一个查询问题,在线等 急急急!!! 对于时间的查询
insert into @t
select '13966759391', '2005-11-17 10:39:50.217' union
select '13966759391', '2005-11-17 10:40:10.077' union
select '13966759391', '2005-11-17 10:40:11.327' union
select '13966759391', '2005-11-17 10:40:12.327' union
select '13900000000', '2005-11-17 10:40:21.590' union
select '13900000000', '2005-11-17 10:40:28.250' union
select '13900000000', '2005-11-17 10:40:29.483'
select number,min(dt) from @t group by number
结果
13900000000 2005-11-17 10:40:21.590
13966759391 2005-11-17 10:39:50.217