我有这种类型的XML。
<Players>
<TeamA name="Kings XI Punjab" Id="1107">
<Player1 Id="270">Virender Sehwag </Player1>
<Player2 Id="10114">Mandeep Singh </Player2>
<Player3 Id="10085">Glenn Maxwell </Player3>
<Player4 Id="5313">David Miller </Player4>
<Player5 Id="4961">George Bailey (C) </Player5>
<Player6 Id="4508">Wriddhiman Saha (W)</Player6>
<Player7 Id="62576">Akshar Patel </Player7>
<Player8 Id="3736">Mitchell Johnson </Player8>
<Player9 Id="4610">Rishi Dhawan </Player9>
<Player10 Id="4997">Parvinder Awana </Player10>
<Player11 Id="10116">Sandeep Sharma </Player11>
</TeamA>
<TeamB name="Kolkata Knight Riders" Id="1106">
<Player1 Id="3723">Robin Uthappa (W)</Player1>
<Player2 Id="3478">Gautam Gambhir (C) </Player2>
<Player3 Id="4276">Manish Pandey </Player3>
<Player4 Id="141">Jacques Kallis </Player4>
<Player5 Id="11803">Suryakumar Yadav </Player5>
<Player6 Id="3724">Yusuf Pathan </Player6>
<Player7 Id="3766">Ryan ten Doeschate </Player7>
<Player8 Id="3729">Piyush Chawla </Player8>
<Player9 Id="11229">Sunil Narine </Player9>
<Player10 Id="3874">Morne Morkel </Player10>
<Player11 Id="5221">Umesh Yadav </Player11>
</TeamB>
</Players>
我希望将这种类型的opf插入到mysql数据库中
Team Player TeamId PlayerId
Kings XI Punjab Virender Sehwag 1107 270
Kolkata Knight Riders Robin Uthappa 1106 3723
一个关于玩家和团队的每个条目,两个ID都应该采用这种格式。 我怎么能这样做。
TeamA Id Player1 Player2 Player3 Kings XI Punjab 5313 Virender Sehwag Mandeep Singh Glenn Maxwell
我正在将这种类型的条目输入我的数据库。如何获取行中所有图层的播放器ID和名称而不是列
我无法通过
执行此操作LOAD XML LOCAL INFILE '/pathtofile/file.xml' INTO TABLE my_tablename ROWS IDENTIFIED BY '<tagname>';
请给我一个合适的解决方案 提前谢谢。