(select A from 'TableB' where C = c and G = g)
intersect
(select A from 'TableB' where C = d and G = h)
首先,因为mysql不提供intersect操作符,所以我将上面编写的查询语句修改如下。
select A
from 'TableB'
where C = c and G = g and A in(
select A
from 'TableB'
where C = d and G = h)
我想使用mongodb得到与上面相同的结果。
还有别的办法吗??
1条答案
按热度按时间up9lanfz1#
此查询将仅返回“a”中匹配的元素
C=c
,D=d
,G=h
,G=g
希望有帮助