Please can i get a help on joining these 3 queries
SELECT customer.id,customer.custid,customer.compname, customer.balance AS balance,customer.phone,acctofficer.acctfullname AS acctoff, STR_TO_DATE(mastorders.lastpaydate,'%d-%m-%Y') AS debtage,customer.depot, STR_TO_DATE(mastorders.lastsuppdate,'%d-%m-%Y') AS purchdate FROM customer,mastorders,acctofficer WHERE customer.custid=mastorders.custid and acctofficer.acctoffid=customer.acctoff GROUP by customer.id ASC
SELECT customer.id,customer.custid,customer.compname, customer.balance AS balance,customer.phone,acctofficer.acctfullname AS acctoff, customer.depot FROM customer,acctofficer WHERE acctofficer.acctoffid=customer.acctoff GROUP by customer.id ASC
SELECT DISTINCT C.custid,T.timestamp AS LastPayDate FROM transactions AS T,customer AS C WHERE T.parttype='Receipt' AND T.custid=C.custid GROUP by T.custid