help me JOIN 3 tables.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have this SQL

SELECT e1.*, l1.* FROM e1
INNER JOIN l1 WHERE e1.entre_active = 'Y' AND l1.entreID = e1.entre_id

The above query works but i want to add the one below

SELECT SUM(a1.adp_amount) as amount FROM a1 WHERE a1.adp_loanID = e1.loanID;

the last part of the query is to SUM the part payment made on table 'l1' and
return total raised with the first query.

the whole idea is three tables, (business, loan, raised), loan referenced ID
from business, raised referenced ID from loan.

loan maybe $300 and it can be raised over time till completed, so all the
amount raised + the loanId will be stored inside the raised table.

Thank you

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux