我正在从成员和费用这两个表中获取数据。我想只选择那些本月没有存款的成员。这是我尝试过的,但结果不是我想要得到的。任何帮助将不胜感激 。我正在使用 mysql 。
SELECT
members.memberid,
members.companyid,
members.name,
members.initials,
members.surname,
members.datejoined,
members.usercode,
members.address,
members.cell,
members.pic,
members.idnumber, members.rank,
members.address2,
fees.feestype,fees.amountpaid,
fees.companyid,fees.paiddate,
fees.usercode
FROM
members
INNER JOIN fees
ON members.memberid = fees.memberid
WHERE
MONTH(fees.paiddate) < MONTH(CURDATE())
AND YEAR(fees.paiddate) < YEAR(CURDATE())