秦皇岛房价最新走势图:查某一字段里,不相同的信息,怎么查?
来源:百度文库 编辑:杭州交通信息网 时间:2024/03/29 09:08:58
比如,一个字段里,有多个 123 这个数据,我只查出最新的一下,怎么查?
就是最新插入的
select * from [table] where name<>'"&str&"'
select top 1 * from [table] where name<>'"&str&"' ORDER BY ID DESC
这个不行,因为,我要查 10 条信息,这10条不能显示是同一个人发的
就是最新插入的
select * from [table] where name<>'"&str&"'
select top 1 * from [table] where name<>'"&str&"' ORDER BY ID DESC
这个不行,因为,我要查 10 条信息,这10条不能显示是同一个人发的
需要在输出的时候作个判断
在循环的时候 查询的人名放入一数组,没查询一条记录 就遍历下数组 看看是否有重复。 总共输出10条就行了。 具体代码就不写了。
select * from [table] where name<>'"&str&"'
select top 1 * from [table] where name<>'"&str&"' ORDER BY ID DESC 这样可以吗?
什么叫最新?