I have the following table in my bank:
"financeiro
financeiro_id INT AUTO_INCREMENT,
financeiro_pagamento DATE,
financeiro_pid INT,
financeiro_valor INT,
";
In this table I record the payments that my system receives, then I use the following Query to return the values:
"SELECT *FROM login lo
inner join financeiro fi on lo.login_id = fi.financeiro_pid
Order by financeiro_pagamento";
This Query takes the financeiro_pid
and joins it with the login
table to know who paid, but I need every record equal to that table to return only the person's last payment. With this Query I'm getting all the payments but I just wanted the last payment from the user.
Note: financeiro_pid
is where I register the user key.