编辑:这样做:
SELECT DISTINCT profileid
FROM profilesrelevation
WHERE profileid NOT IN (
SELECT profileid FROM profiles
)
Run Code Online (Sandbox Code Playgroud)
我需要获取profilesrelevation表中存在但不在profiles表中的profileid值
profiles表有8107个不同的"profileid"值,而profilesrelevation表有8380个不同的"profilesid"值......
profiles.profileid
profilesrelevation.profileid
select * from profiles, profilesrelevation
where profilesrelevation.profileid != profiles.profileid
Run Code Online (Sandbox Code Playgroud)
不起作用,怎么样?