-
列转行2 select user_name,'arms' as equipment, arms from user1 a join user1_equipment b on a.id=user_id union all select user_name,'clothing' as equipment, clothing from user1 a join user1_equipment b on a.id=user_id; union all select user_name,'shoe' as equipment, shoe from user1 a join user1_equipment b on a.id=user_id;查看全部
-
列转行 select user_name,replace(substring(substring_index(mobile,','a.id),char_length(substring_index(mobile,',',a.id-1))+1),',','') as mobile from tb_sequence as a cross join( select user_name,concat(mobile,',') as mobile,length(mobile)-length(replace(mobile,',',''))+1 as size from user1 as b) as b on a.id<=b.size查看全部
-
行列转换 declare @sql nvarchar(1000) set @sql='select cl ' select @sql=@sql+',sum(case when ck='''+ck+''' then sl else 0 end) as '''+ck+'''' from table1 group by ck set @sql=@sql+' from table1, group by cl' execute sp_execute sql @sql查看全部
-
删除字段中的重复数据查看全部
-
case实现行转列。查看全部
-
处理重复数据查看全部
-
存储过程查看全部
-
创建序列查看全部
-
列转行的情景查看全部
-
先实现列转行,用上节简单删除,再转回来查看全部
-
更复杂的情况查看全部
-
删除重复数据查看全部
-
有很好的并发性查看全部
-
调用存储过程来生成特殊的序列号查看全部
-
唯一序列号生成原则查看全部
举报
0/150
提交
取消