-
列转行的方式:union方式和序列号的方式
查看全部 -
列转行的另外一种:
查看全部 -
列转行,唐僧 12,23,23,2转成唐僧 12 唐僧23:
查看全部 -
行转列:cross join
查看全部 -
使用UNION方法实现列转行
SELECT user_name,'arms' AS equipment,arms FROM user1 a JOIN user1_equipment b ON a.id=b.user_id UNION ALL SELECT user_name,'clothing' AS equipment,clothing FROM user1 a JOIN user1_equipment b ON a.id=b.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
查看全部 -
SELECT
*
FROM
(
SELECT
SUM
(kills)
AS
'a'
FROM
a
INNER
JOIN
b
ON
a.
name
=b.user_name
WHERE
a.
name
=
'a'
)
AS
a;
CROSS
JOIN
(
SELECT
SUM
(kills)
AS
'b'
FROM
a
INNER
JOIN
b
ON
a.
name
=b.user_name
WHERE
a.
name
=
'b'
)
AS
b;
CROSS
JOIN
(
SELECT
SUM
(kills)
AS
'c'
FROM
a
INNER
JOIN
b
ON
a.
name
=b.user_name
WHERE
a.
name
=
'c'
)
AS
c;
查看全部 -
生成序列号的方法
查看全部 -
12345
查看全部 -
序列化表列转行
查看全部 -
union的方法实现列转行
查看全部 -
利用序列化表处理列转行
查看全部 -
创建一张序列化表并插入(行转列)
查看全部 -
case when.....then方法行转列
查看全部 -
mysql 使用 case when 实现行转列
查看全部
举报