如果是SQL Server
则为:
select top(5) * from Dv_bbs1 where RootID = 21445 and username!=roger;
如果是MYSQL
select * from Dv_bbs1 where RootID = 21445 and username!=roger limit 0,5
select top 3 mdg,count(mdg) cont,qd,hx from HxTable
where Qsg ='青岛' group by mdg,qd,hx
order by count(mdg) desc
也不知道你的 HxTable表什么样子,随便写了个,没测试。
去这里学习一下吧,里面资料很全面。看过之后相信你自己能解决问题!
加油
SELECT * FROM Dv_bbs1
WHERE RootID = 21445
AND UserName <> 'roger'
SELECT * FROM Dv_bbs1
WHERE (RootID = 21445 and USERNAME<>'roger')
select * from Dv_bbs1 where RootID = 21445 and username = roger