我想遍历一个集合并为每个插入一行,这是在SQLite中吗?
这是我拥有的,但我想为每个skill_point_type插入1个项目。现在它只是从skill_point_type中抓取一行并插入一个项目:
<div id="MyDiv1">
<input id="myInput" type="text"/>
<div id="myDiv2">
<label class="container">One
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
</div>
<div style="display:none">
<span> aaa </span>
</div>
</div>
答案 0 :(得分:4)
INSERT INTO skill_points (skill_point_type_name, player_name, skill_points)
SELECT name, 'hat', 0 FROM skill_point_type
答案 1 :(得分:0)
不要使用子查询:
INSERT INTO skill_points (skill_point_type_name, player_name, skill_points)
SELECT name, 'hat', 0
FROM skill_point_type;