Select huifuid,huiyongh,huishij from
(select ID,huifuid,huiyongh,huishij from tiezi where boardid='"+board+"' and huiyongh='"+usernames+"') A
Where ID IN (Select Max(ID) from tiezi Group By huifuid )
Order by id desc
解决方案 »
- SQL Web Data Administrator怎么用?
- 查询
- 我这段代替游标的代码有问题吗,为啥老这么慢?
- 高分,数据库设计问题,多个小表合成一个大表效率高,还是多个小表效率高。
- 关于sql数据导入到excel时sql数据替换问题
- 错误求助:将数据类型 varchar 转换为 float 时出错。
- 有两个表,怎么用SQL输出成表三? 刚有点乱,重新发.
- 我用的是2000server的操作系统,装的是sqlserver7.0,我更改完2000的登录密码后,再进入sqlserver,sigh,sql server service manager就无
- 请问这样的Sql应该怎么写
- MySQL导出insert into语句
- While 语句的问题
- 请高手解决replistor同步后,MSSQL数据库出现了“置疑”
楼上的语句应该可以。也可以这么写。select huifuid,huiyongh,huishij from tiezi A
where boardid='"+board+"' and huiyongh='"+usernames+"'
And ID IN (Select Max(ID) from tiezi Where huifuid=A.huifuid)
Order by id desc
where boardid='"+board+"' and huiyongh='"+usernames+"' and
huiyongh in(select max(ttt.huiyongh) from tiezi as ttt group by(ttt.huifuid))
Order by id desc