清理无效ID的sql命令!
create proc MY_CLEAR_NOCHARID
as
delete from memb_info
where memb___id in
(select memb___id from memb_info
left join character on (character.accountid=memb_info.memb___id)
where character.accountid is null)
delete from vi_curr_info
where memb___id in
(select memb___id from vi_curr_info
left join character on (character.accountid=vi_curr_info.memb___id)
where character.accountid is null )
delete from accountcharacter
where id in
(select id from accountcharacter
left join character on (character.accountid=accountcharacter.id)
where character.accountid is null )
delete from warehouse
where accountid in
(select warehouse.accountid from warehouse
left join character on (character.accountid=warehouse.accountid)
where character.accountid is null )
GO
本文出自 7j45 > 奇迹一条龙