想要从表A中检索列,其中该列位于表B中且行少于2

时间:2017-03-17 05:53:38

标签: phpmyadmin

如果捐赠者想要捐赠,他应该与receive donation table的接收者联系,他们没有收到捐款或者捐赠的次数少于2次?

The image is here

1 个答案:

答案 0 :(得分:0)

您可以使用INNER JOIN。像这样:

SELECT A.column1 FROM table_A A
INNER JOIN 
table_B B ON A.column1 = B.column2 
group by B.column2 
having COUNT(B.column2)<2