Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06.03.2007, 19:48   #7
hr
Архивный участник
 
Join Date: Jun 2005
Posts: 285
Default

Quote:
if someone know how to clean up pet_data this will be nice.
comments/suggestions are welcome.
haven't tested, but maybe so:
1) before item deletion
Code:
delete from pet_data where pet_id in (select ui.item_id from user_item as ui left join user_data as ud on (ui.char_id=ud.char_id) where ud.account_id = - 1);
--or--

2) after item deletion
Code:
delete from pet_data where pet_id not in (select item_id from user_item);
ps: btw your item deletion is wrong. it may delete some pledges' items. this one more correct:

Code:
delete from user_item where item_id in (select ui.item_id from user_item as ui left join user_data as ud on (ui.char_id=ud.char_id) where ud.account_id = - 1 and ui.warehouse<>2);
pps: better use user_deleted table to get info about deleted chars
hr is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 15:55.