mysql - 创建了一个合并两个表 branch_mstr 和 new_branches 的过程(只有两个字段和相同的主键)
问题描述
delimiter $$
create procedure mergeData()
begin
declare counter, rowws int default 0;
set rowws = (select count(*) from new_branches);
begin
while counter < rowws do
if new_branches.branch_no != branch_mstr.branch_no then
insert into branch_mstr value(new_branches.branch_no, new_branches.name);
end while;
end;
end$$
delimiter ;
解决方案
推荐阅读
- javascript - 如何以角度在 ag grid masterdetail 的 detailCellRendererParams 内进行控制台
- shell - 如何使用 shell 脚本过滤字符串
- karate - 空手道加特林:未获取对功能文件的更改
- flutter - 未处理的异常:MissingPluginException(未找到对通道 plugins.flutter.io/connectivity 进行方法检查的实现)
- javascript - 我需要从地址获取纬度和经度
- windows - 为什么 Windows 10 不允许我设置我的 Windows 管理员用户名?
- dji-sdk - java.lang.NoClassDefFoundError:解析失败:Ldji/sdk/sdkmanager/DJISDKManager;
- excel - 用相同颜色标记一列中的相同字符串
- python - 并行处理一个txt文件
- google-play - 在 Google Play 中发布应用时应该选择哪种语言?