select T.std_name,T.sub_title from (select A.std_id,A.std_name,B.sub_id,B.sub_title from tb1 A,tb2 B)T left join tb3 C on T.std_id=C.std_id and T.sub_id=C.sub_id where C.score is null
select s.STD_ID ,s.DTD_NAME ,t.SUB_ID ,t.SUB_TITLE from student s,subject t where not exists (select 1 from score where STD_ID=s.STD_ID and SUB_ID=t.SUB_ID) 假设第一个表名为 student 楼主只需要执行,不要问S是什么,T是什么。 解释起来两个字“别名”, 但估计这样解释无法让你明白。如果语句有什么不对或报错,则把你的语句和错误信息一同贴出。
from
(select A.std_id,A.std_name,B.sub_id,B.sub_title
from tb1 A,tb2 B)T left join tb3 C on T.std_id=C.std_id and T.sub_id=C.sub_id
where C.score is null
from student s,subject t
where not exists (select 1 from score where STD_ID=s.STD_ID and SUB_ID=t.SUB_ID)
假设第一个表名为 student 楼主只需要执行,不要问S是什么,T是什么。 解释起来两个字“别名”, 但估计这样解释无法让你明白。如果语句有什么不对或报错,则把你的语句和错误信息一同贴出。
话说版主的头像很霸气,吓屎我了..