Unanswered: I have a problem with JOIN for 3 tables - Select last recod
This is the Databases (for example)
I have this code
FROM vouchers AS A
LEFT JOIN cod_return B ON A.voucher = B.voucher_id
LEFT JOIN STATUS C ON A.voucher = C.voucher_id
WHERE B.voucher_id IS NULL
AND B.date IS NULL
AND A.name IS NOT NULL
AND C.status = "delivered"
LIMIT 0 , 30
So, I get data from 3 tables, only if the C.status = "delivered". I want to get the last data of that voucher on table "status", doesn't matter if it is "delivered".