显示每个用户前两条数据 id name sdate edate user 怎样才能显示每个用户前两条数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tablename awhere id in (select top 2 id from tablenamewhere user=a.userorder by id) --user是系统保留字,加[]select * from 表名 Awhere id in (select top 2 id from 表名 where [user]=A.[user] order by id) select * from tablename awhere 2>(select count(1) from tablename where [user]=a.[user] and [id]<=a.[id]) SQL新手问CHECK约束的问题 重复执行的作业,时间按第一次执行的时间吗?是什么? 求一简单sql语句 为什么连接不上查询分析器 批量数据处理问题!急!!!帮帮忙 求一简单SQL语句(期待...) 如何知道一个表的名字? 关于字符串排序问题 when should you backup read-only tablespace? 有密码保护的access意外退出,结果下一次进入时怎么也打不开,怎么打开?或怎么取消密码保护? SQL SERVER 2000,更改自定义数据类型的所有者! 十万火急!!!!!!!!!!mysql数据库数据想转出到sql server,怎么办???
where id in (
select top 2 id from tablename
where user=a.user
order by id
)
--user是系统保留字,加[]select *
from 表名 A
where id in (select top 2 id from 表名 where [user]=A.[user] order by id)
where 2>(select count(1) from tablename where [user]=a.[user] and [id]<=a.[id])