I am lookign for the correct SQL code to join 2 tables and show only the last record of the details table.
I have a DB with 2 tables,
Deals Deal
What about this query.
select * from Deals left join DealComments on Deals.DealID = DealComments.DealID and DealComments.CommentTime = (SELECT CommentTime FROM DealComments WHERE DealComments.DealID = Deals.DealID ORDER BY CommentTime DESC limit 1)