select username,max(id) as id,max(content) as content
from 你的表
group by username
from 你的表
group by username
解决方案 »
- win7 下安装 sql server2005 出现reporting serverice 安装失败
- SQL Server 2005远程连接不了,本地连接正常,求解决办法,在线等!~~
- 事务使用的疑惑,问题很初级....
- 手机号码中间几位用星号代替
- 存储过程中 如何使用 另外一个存储过程返回的记录集
- 有用过SQLSERVER2005订阅复制的过来说明一下
- 各位专家,大家好,现在十万火急,我用sqlserver2005调用c#写的dll,报一个错误 hr:0x80131700
- 如何将文本文件导入SQL数据库(无字段终止符)
- 字符串转换日期
- 谁有关于"存储过程"的资料?
- 急,在线等 小弟跪求!!!用WIN98连接数据服务器上的SQLSERVER2000数据库连接出错,请高手指点
- 无法保存关系图,如何删除表的关联?
from 表 group by username
select *
from tablename
where id in ( select max(id)
from tablename
group by username
)
from 表 a
where id = (select max(id) from 表 where username = a.username )
select *
from 表 a
where not exists (select 1 from 表 where username = a.username and id > a.id)