日期:2014-05-16 浏览次数:20739 次
select account.* from T_UserAccount account left join T_User_Bill bill on account.UserID = bill.UserID where bill.UserID is null;
------解决方案--------------------
在T_User_Bill 的UserID上加索引
select *
from T_UserAccount A
where not exists (select 1 from T_User_Bill B where A.UserID =B.UserID )
------解决方案--------------------
SELECT * FROM T_UserAccount A WHERE not EXISTS(SELECT 1 FROM T_User_Bill B WHERE A.UserID=B.UserID);
------解决方案--------------------
SELECT account.UserID, account.Account,account.LastAccessMsg,account.LastAccessTime,account.CreateTime
FROM T_UserAccount account
WHERE not exists (select 1 from T_User_Bill where UserID=account.UserID)