sql的题目如下所示,查询出重复的电子邮箱
解法(1):查询出查询出Email相等 Id不相同的数据具体语句如下所示:
select a.Email from Person as a,Person as b where a.Emailb.Email and a.Id!b.Id此时我们可以看到我们的语句中输出了2次结果但是预期结果只输出了1次…
解法(1):思路为先查询出订购的客户再使用not in查询出不包含订购客户的其他人也就是从来不订购的客户 查询出订购的客户语句:
select a.Id from Customers as a,Orders as b where b.CustomerIda.Id再使用not in 查询 不再里面的客户
select Name as Customers fr…