摘要: 由于项目的原因,需要将一些记录分类汇总,但还要列出相关的明细,这样的需求我还是第一次遇到,蛋疼了,还是请求一下度娘吧。搜索一番还是有结果,请看以下例子:create table tb ([id] int,[name] varchar(2))insert into tbselect 1,'aa' union allselect 2,'bb' union allselect 1,'cc' union allselect 3,'dd' union allselect 2,'ee' select * from tb--查询 阅读全文
posted @ 2013-10-27 23:53 shoupifeng 阅读(668) 评论(0) 推荐(0) 编辑