SELECT
Boats.id, Boats.date, Boats.section, Boats.raft,
river_company.company, river_section.section AS river
FROM Boats
INNER JOIN river_company ON Boats.raft = river_company.id
INNER JOIN river_section ON Boats.section = river_section.id
ORDER BY Boats.date DESC, river, river_company.company
Returns everything I need. But how would I add a [Photos] table and count how many times Boats.id occurs in it and add that to the returned rows.
So if there are 5 photos for boat #17 I want the record for boat #17 to say PhotoCount = 5