主要用cross join 就可以查询出这积
insert into tbmcd_config_city_perform
(editor,edittime,city_id,post_id,perform_id,change_value)
select '{0}','{1}', 0, post_id ,perform_id,'0.00'
from (select id as post_id from tbmcd_position where id={2})a
cross join (select id as perform_id from tbmcd_perform) b
关系两个表进行二维信息SQL中cross join
最新推荐文章于 2023-07-26 14:28:47 发布
本文介绍了一种使用CrossJoin进行数据插入的方法。具体操作为:通过CrossJoin将两个子查询结果进行笛卡尔积运算,并将结果插入到指定表中。此方法适用于需要生成大量测试数据或初始化配置数据的场景。
1478

被折叠的 条评论
为什么被折叠?



