发布网友 发布时间:2024-09-28 02:06
共2个回答
热心网友 时间:2024-09-28 02:15
SELECT
*
FROM
member
WHERE
NOT EXISTS (
SELECT 1
FROM
score
WHERE
member.mid = score.mid
);
mid mname
---------- --------------------------------------------------
M005 阳阳
M010 香奈儿
(2 行受影响)
这个结果?
热心网友 时间:2024-09-28 02:10
用游标来做:
declare cur cursor for select mid from member
open cur
declare @mid varchar(50)
fetch cur into @mid
while(@@fetch_status=0)
begin
--select @mid
select @mid,a.fname from course a where a.fid not in (select fid from score where mid=@mid)
fetch cur into @mid
end
close cur
deallocate cur