002.sql 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. update aim_place_position
  2. set front_level_id = null
  3. where id in (select id
  4. from (select a1.id
  5. from aim_place_position a1
  6. left join aim_place_position a2 on a1.front_level_id = a2.id
  7. where a1.front_level_id is not null
  8. and a2.id is null) t);
  9. update land_mark
  10. set front_level_id = null
  11. where id in (select id
  12. from (select a1.id
  13. from land_mark a1
  14. left join land_mark a2 on a1.front_level_id = a2.id
  15. where a1.front_level_id is not null
  16. and a2.id is null) t);
  17. update area_info
  18. set template_id = null
  19. where id in (select id
  20. from (select area_info.id
  21. from area_info
  22. left join aim_group_info on area_info.template_id = aim_group_info.id
  23. where area_info.template_id is not null
  24. and aim_group_info.id is null) t);
  25. update thing_info
  26. set template_id = null
  27. where id in (select id
  28. from (select thing_info.id
  29. from thing_info
  30. left join aim_group_info on thing_info.template_id = aim_group_info.id
  31. where thing_info.template_id is not null
  32. and aim_group_info.id is null) t);