吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 863|回复: 15
收起左侧

[已解决] MySQL求助

[复制链接]
HK仅輝 发表于 2022-9-26 14:26
本帖最后由 HK仅輝 于 2022-9-26 16:13 编辑

如同,把每行转为图中格式,sql可以直接处理吗?
QQ图片20220926142414.png

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

youth96 发表于 2022-9-26 14:32
使用union
(select total_count,'total_count' from a) union (select check_wait,'check_wait' from a) union (select check_fail,'check_fail' from a)
xlong224 发表于 2022-9-26 14:36
先使用GROUP_CONCAT 分隔
然后使用SUBSTRING_INDEX 处理
参考https://www.pianshen.com/article/91471985332/
霍大爷来玩破解 发表于 2022-9-26 14:38
youth96 发表于 2022-9-26 14:32
使用union
(select total_count,'total_count' from a) union (select check_wait,'check_wait' from a)  ...

你好,你的回答【select total_count,'total_count' from a】中,我不理解 【total_count,'total_count'】,这能查出来啥,还是起的别名?
youth96 发表于 2022-9-26 14:41
霍大爷来玩破解 发表于 2022-9-26 14:38
你好,你的回答【select total_count,'total_count' from a】中,我不理解 【total_count,'total_count' ...

total_count是楼主截图的字段名啊,select 字段啊,加引号就是对应的字符串了,  这两个就是他需要的value和type了
霍大爷来玩破解 发表于 2022-9-26 14:46
youth96 发表于 2022-9-26 14:41
total_count是楼主截图的字段名啊,select 字段啊,加引号就是对应的字符串了,  这两个就是他需要的valu ...

了解,谢谢
SpeII 发表于 2022-9-26 14:49
用case when试试,参考mysql行转列
 楼主| HK仅輝 发表于 2022-9-26 14:54
youth96 发表于 2022-9-26 14:32
使用union
(select total_count,'total_count' from a) union (select check_wait,'check_wait' from a)  ...

感谢,感谢
 楼主| HK仅輝 发表于 2022-9-26 14:55
xlong224 发表于 2022-9-26 14:36
先使用GROUP_CONCAT 分隔
然后使用SUBSTRING_INDEX 处理
参考https://www.pianshen.com/article/91471985 ...

感谢,感谢
 楼主| HK仅輝 发表于 2022-9-26 14:59
SpeII 发表于 2022-9-26 14:49
用case when试试,参考mysql行转列

感谢,感谢
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-15 00:31

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表