两个问题:
1)我希望把数据库中所有点击次数相同的记录只取出其中的一条,如何做?(我用了select distinct hits,name,type from mydbtable order by hits,结果还是把所有点击次数相同的记录全部取出来了。这是为什么?应该如何做?)2)我的页面上有一个下载地址的超链接,我希望在点击链接下载文件的同时,更新数据库的hits字段,该如何做?(我用了linkbutton,虽然可以更新数据库,但却不能下载文件?这是为什么,应该如何做?)请高手给予帮助!!!谢谢了。
1)我希望把数据库中所有点击次数相同的记录只取出其中的一条,如何做?(我用了select distinct hits,name,type from mydbtable order by hits,结果还是把所有点击次数相同的记录全部取出来了。这是为什么?应该如何做?)2)我的页面上有一个下载地址的超链接,我希望在点击链接下载文件的同时,更新数据库的hits字段,该如何做?(我用了linkbutton,虽然可以更新数据库,但却不能下载文件?这是为什么,应该如何做?)请高手给予帮助!!!谢谢了。
select hits
from mydbtable
GROUP BY hits
order by hits
count.aspx,用来统计次数
下载地址:count.aspx?target=aaaaa.rar
取参数更新hits!
from mydbtable
GROUP BY hits,name,type
order by hits
(select top 1 name from mydbtable where hits=mydbtable.hits) name,
(select top 1 type from mydbtable where hits=mydbtable.hits) type
from mydbtable