PDA

View Full Version : Xin query delete tài khoản trống.



yunathem
16-08-11, 11:16 PM
Bạn nào biết query delete tài khoản trống thì chỉ cho mình zoi.

newbie1
16-08-11, 11:24 PM
* Thử chạy query này xem

delete from memb_info
where memb___id not in (
select memb___id from memb_stat)

delete from accountcharacter
where id not in (
select memb___id from memb_stat)

delete from character
where accountid not in (
select memb___id from memb_stat)

delete from warehouse
where accountid not in (
select memb___id from memb_stat)


* hoac dung query xoa tk ko connect từ ngày bao nhiêu đó chẳng hạn

delete from memb_info
where memb___id in (
select memb___id from memb_stat where disconnecttm<'2011-xx-yy')

delete from accountcharacter
where id in (
select memb___id from memb_stat where disconnecttm<'2011-xx-yy')

delete from character
where accountid in (
select memb___id from memb_stat where disconnecttm<'2011-xx-yy')

delete from warehouse
where accountid in (
select memb___id from memb_stat where disconnecttm<'2011-xx-yy')

xx: tháng
yy: ngày

yunathem
17-08-11, 12:12 AM
Không có tác dụng.................!

newbie1
17-08-11, 12:13 AM
chinh SQL muonline chua........................

yunathem
17-08-11, 12:15 AM
Đã chỉnh MuOnline....................!

shad0w.hunter
17-08-11, 02:28 AM
Nếu tài khoản trống nghĩa là chưa tạo nhân vật nào thì dùng cái này :">


DELETE FROM MEMB_INFO WHERE memb___id IN (SELECT ID FROM AccountCharacter WHERE (GameID1 IS NULL) AND (GameID2 IS NULL) AND (GameID3 IS NULL) AND (GameID4 IS NULL) AND (GameID5 IS NULL))


Nếu bị lỗi "Cannot resolve the collation conflict between" vớ vẩn gì đấy thì dùng câu dưới >"<


DELETE FROM MEMB_INFO WHERE memb___id COLLATE SQL_Latin1_General_CP1_CS_AS IN (SELECT ID COLLATE SQL_Latin1_General_CP1_CS_AS FROM AccountCharacter WHERE (GameID1 IS NULL) AND (GameID2 IS NULL) AND (GameID3 IS NULL) AND (GameID4 IS NULL) AND (GameID5 IS NULL))