mysql是否有相反但等效的UNION函数?
我知道可以用更长的查询来做到这一点,但我很好奇是否有一个等效的函数.
我有2个不同表的2个select语句
select state, state_name, id, idname, phone, mobile, home from table1
select state, state_name, id, idname, phone, mobile, home from table2
Run Code Online (Sandbox Code Playgroud)
我需要一个仅从table1中获取的查询,并且只有当table1中的idname,phone,mobile,home与table2不匹配时才会查询
例如:Table1有
AK | Alaska | 1 | row6 | 453 | 567 | 123
Run Code Online (Sandbox Code Playgroud)
但表2有:
AK | Alaska | 1 | row6 | 453 | 567 | 123
AK | Alaska | 1 | row6 | NULL | 567 | 123
AK | Alaska | 1 | tttttt | 453 | 567 | 123
Run Code Online (Sandbox Code Playgroud)
查询将显示
AK …Run Code Online (Sandbox Code Playgroud)