资源表对应的source字段变更,对应的表 resource_info、file_info、resource_info_history 逻辑: source为2d的 改成abooks source为abook outId为空的 改为abooks type为hep5 、sourc为urc的 改为dbook,写出sql语句
时间: 2024-02-16 17:05:21 浏览: 68
好的,根据您的要求,我可以为您提供以下 SQL 语句来完成资源表对应的 source 字段变更:
```
-- 修改 resource_info 表中的 source 字段
UPDATE resource_info SET source = 'abooks' WHERE source = '2d';
UPDATE resource_info SET source = 'abooks' WHERE source = 'abook' AND outId IS NULL;
UPDATE resource_info SET source = 'dbook' WHERE source = 'urc' AND type = 'hep5' AND outId IS NULL;
-- 修改 file_info 表中的 source 字段
UPDATE file_info SET source = 'abooks' WHERE source = 'abook' AND outId IS NULL;
UPDATE file_info SET source = 'dbook' WHERE source = 'urc' AND type = 'hep5' AND outId IS NULL;
-- 修改 resource_info_history 表中的 source 字段
UPDATE resource_info_history SET source = 'abooks' WHERE source = 'abook' AND outId IS NULL;
UPDATE resource_info_history SET source = 'dbook' WHERE source = 'urc' AND type = 'hep5' AND outId IS NULL;
```
希望能够帮到您!
阅读全文