select top 18 id,bumid,buname,buimg,bumebtype from bloguser where buptid=66 and bumid<>282 and bumid not in( select bfid from BlogFriends where mid=282) order by NewID()
------解决思路----------------------
not in 换 not exists试试
and not exists (select 1 from BlogFriends where mid=282 and bloguser.bumid = bfid)
------解决思路----------------------
select * from (select id,bumid,buname,buimg,bumebtype from bloguser
where buptid=66 and bumid<>282 ) as a left join blogfriends as b
on b.mid=282 and a.bumid=b.bfid
where b.bfid is null
order by NewID()
试试 貌似效率不会提高吧