select top pagesize * from tableName where id not in(select top (page-1)*pagesize+1 id form tableName order by id) order by id 分页的sql server
select id,groupName from sh_mjgroup where charindex(','+ltrim(id)+',' , ','+(select mj from sh_auth where cardNo='A0001')+',') > 0
varchar转换为int
select (select text+',' from sh_meetingservice where id in (1,2,3) for xml path('')) as txt;
将多行合并为一行
select topic from sh_meeting where topic is not null group by topic having count(*)>10
判断表中某个字段是否有重复个数超过10条的