clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335534 fiddles created (27403 in the last week).

CREATE TABLE members ( memberid integer PRIMARY KEY, name varchar(100) ) ;
 hidden batch(es)


INSERT INTO members (memberid, name) VALUES (1, 'member 1'), (2, 'member 2') ;
 hidden batch(es)


CREATE TABLE fees ( memberid integer REFERENCES members(memberid), amountpaid decimal(10,2) NOT NULL, paiddate date NOT NULL ) ;
 hidden batch(es)


INSERT INTO fees (memberid, amountpaid, paiddate) VALUES (1, 100.0, curdate()), (2, 100.0, curdate() - interval 1 month);
 hidden batch(es)


SELECT * FROM fees JOIN members ON fees.memberid = members.memberid;
memberid amountpaid paiddate memberid name
1 100.00 2019-06-17 1 member 1
2 100.00 2019-05-17 2 member 2
 hidden batch(es)


SELECT memberid, name /* , and anything you need */ FROM members /* JOIN fees ON fees.memberid = members.memberid */ WHERE NOT EXISTS ( /* any payment from this specific member this month */ SELECT 1 FROM fees WHERE fees.memberid = members.memberid AND YEAR(paiddate) = YEAR(curdate()) AND MONTH(paiddate) = MONTH(curdate()) ) ;
memberid name
2 member 2
 hidden batch(es)