对于此表,每一列都有不同的行,即count(Name)= count(Spouse_Name)= count(*)想要编写一个SQL查询,其中对(名称和Spouse_Name)是不同的,即Alex Sandra和Sandra Alex相同。
输出应为以下内容:
注意:如果可能,请使用内部联接。
假设name和spouse_name在同一行中永远不会相等,您可以像这样使用NOT EXISTS:
name
spouse_name
NOT EXISTS