我的问题与此非常相似。

(SELECT emailid FROM usereducation WHERE presfuncarea = '$funcarea')
intersect
(SELECT emailid FROM userprofession WHERE totexpyear >= '$minexp')

因为mysql不支持intersect,所以我必须找到正确的解决方案。

最佳答案

这应该可以做到:

SELECT p.emailid
FROM usereducation e JOIN userprofession p ON p.emailid = e.emailid
WHERE e.presfuncarea = '$funcarea'
AND p.totexpyear >= '$minexp'

09-25 21:57