为了账号安全,请及时绑定邮箱和手机立即绑定

反向行列转换

如果是换过来呢?如何把右边的格式转为左边的?

正在回答

1 回答

http://img1.sycdn.imooc.com//574d3c2e000159e409560279.jpg

问题是怎么从右边转换为左边,我自己的答案是:

select  user_name,(select eq_name from `test_game` b where b.user_name = a.user_name and b.equipment = 'arms' ) as arms,(select eq_name from `test_game` c where c.user_name = a.user_name and c.equipment = 'clothing' ) as clothing ,(select eq_name from `test_game` d where d.user_name = a.user_name and d.equipment = 'shoe' ) as shoe from `test_game` a  group by a.user_name;

感觉子查询太多了,效率有点低,哪位大神帮忙优化一下?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

反向行列转换

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号