Kamis, 19 April 2012

MySQL : Limiting result in joined table

I have two tables : tableA(idA,titleA) and tableB(idA,idB,textB) with a one to many relationship between them. For each row in tableA, I want to retrieve the last 5 rows corresponding in tableB. I've try SELECT * FROM tableA INNER JOIN tableB ON tableA.idA = tableB.idA LIMIT 5 but it's just limiting the global result of INNER JOIN whereas I want to limit the result for each different

0 comments:

Posting Komentar