我有这样的事情:
&mut b'-' => {
if let Some(next) = iter.peek() {
if b'-' == **next {
*ch = b' ';
mode = Mode::COMMENT;
}
}
}
我需要获取隐藏在第一个或第二个表中的记录。我检查了,我将相同的数据插入第二个表。这个SELECT向我展示了常见的记录,但我只想要第一个或第二个表中的唯一记录。
答案 0 :(得分:1)
根据您的评论,我修改了查询。以下是示例数据的两个示例:
<强>学生强>
<强>指导员强>
<强>查询强>
/* Adam is a pupil but not an instructor */
select Pupil.*
from Pupil
left join Instructor on Pupil.email = Instructor.email
where Instructor.email is null
and Pupil.email = 'Adam@abc.com'
union
select Instructor.*
from Instructor
left join Pupil on Pupil.email = Instructor.email
where Pupil.email is null
and Instructor.email = 'Adam@abc.com';
/* Chris is an instructor but not a pupil */
select Pupil.*
from Pupil
left join Instructor on Pupil.email = Instructor.email
where Instructor.email is null
and Pupil.email = 'Chris@abc.com'
union
select Instructor.*
from Instructor
left join Pupil on Pupil.email = Instructor.email
where Pupil.email is null
and Instructor.email = 'Chris@abc.com';
找到一个有效的例子