I have two tables. Here is a simplified breakdown:
Table #1 - Album:
Rows:
albumId | title | userId
Table #2 - Photo:
Rows:
photoId | src | albumId
I want to get the first photo's src from each album. This is pretty clearly not what I'm looking for but here is what I have:
SELECT pa.id, pa.title, p.src
FROM Album pa
LEFT JOIN Photo p ON pa.Id = p.albumId
WHERE pa.userId = 1
That returns all of the photos from the user. I would like the first result for each album in those results.