摘要: 1.首先介绍ROW_NUMBER() OVER的基本用法2.看一下实例数据初始化数据create table employee (empid int ,deptid int ,salary decimal(10,2))insert into employee values(1,10,5500.00)insert into employee values(2,10,4500.00)insert into employee values(3,20,1900.00)insert into employee values(4,20,4800.00)insert into employee values 阅读全文
posted @ 2012-12-13 15:14 Aaron.Wu 阅读(255) 评论(0) 推荐(0) 编辑
摘要: SELECT 表名 = case when a.colorder=1 then d.name else '' end,表说明 = case when a.colorder=1 then isnull(f.value,'') else '' end,字段序号 = a.colorder,字段名 = a.name,标识 = case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end,主键 = case when exi 阅读全文
posted @ 2012-12-13 15:08 Aaron.Wu 阅读(222) 评论(0) 推荐(0) 编辑