关于sql列表的问题 [英] the problem which is about listing of sql'
本文介绍了关于sql列表的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获得3个数据,这些数据最后已与选择命令"添加在一起.但是,我已经完成的命令,不是前三个命令,而是所有这些命令,或者我要添加一个计数器或其他东西吗?是这样吗?请帮我吗?
I want to get 3 datas which has been added lastly with ''select command''.But,the commands which I have done,not first three command but also all of them or Am I going to add a counter or something like that?Could you help me,please?
推荐答案
如果您真的想检索添加到数据库中的最后三个项目,那么我将使用数据库字段来保留输入日期和时间,并检索按该字段排序的前三项:
If you really want to retrieve the last three items added to a database, then I would use a database field to hold the entry date and time, and retrieve the TOP three items sorted by that field:
SELECT TOP 3 * FROM myTable ORDER BY datePosted DESC
这篇关于关于sql列表的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文