表名 11111
字段: time TOC
数据: 2006-4-5 0:00 15
2006-4-5 1:00 15
2006-4-5 3:00 15
2006-4-5 4:00 101
2006-4-5 6:00 21
2006-4-5 10:00 8
............. ...我想请教一下: selectstr = "select distinct(TOC) from [11111]" TOC改变时,如何把相对应的time也显示出来(只考虑TOC改变时的字段)...语句该怎么写...谢谢!
不知道这题值多少积分...
字段: time TOC
数据: 2006-4-5 0:00 15
2006-4-5 1:00 15
2006-4-5 3:00 15
2006-4-5 4:00 101
2006-4-5 6:00 21
2006-4-5 10:00 8
............. ...我想请教一下: selectstr = "select distinct(TOC) from [11111]" TOC改变时,如何把相对应的time也显示出来(只考虑TOC改变时的字段)...语句该怎么写...谢谢!
不知道这题值多少积分...
from 11111 a
where not exists(select top 1 * from 11111 where TOC=a.TOC and time>a.time)
我的意思是:把不同的TOC显示出来...同时把不同TOC对应的time字段显示出来...谢谢两位!
请教了其他人:得用两个SQL语句才能完成:
select distinct(toc) from [11111] 找出 不同 toc 的数据集,然后,根据数据集中的内容, 用 select min([time]) from [11111] where ( toc='" & toc的数据集.fields(0).value & "')" ...谢谢两位!