我有这个MySQL查询。它会产生Unknown column 'lp.amount' in 'field list'
SELECT l.*, SUM(lp.amount) AS landPayMonth, p.pName, u.uName, SUM(ci.amount) AS totAmnt, t.unitId FROM (SELECT distinct landlord_payment.id FROM landlord_payment) lp, (SELECT distinct cashIn.id FROM cashIn) ci, landlords l, properties p, units u, tenants t WHERE ci.tenantId=t.id AND l.id=lp.landlordId AND t.unitId=u.id AND u.propertyId=p.id AND p.landlordId=l.id AND STR_TO_DATE(ci.registeredTime, "%Y-%m")=STR_TO_DATE(CURDATE(), "%Y-%m")
GROUP BY l.id;
请帮帮我。
答案 0 :(得分:1)
pmap_dbl(list(sim$a, sim$b), add_2)
您可以尝试以上代码。
希望这会对你有所帮助。