I've Client Client can have N Delivery Each Delivery can have N Sms
Delivery has client_id Sms as Delivery_id
I'd like to retrieve all sms from Sms table, but max 10 sms for each client.
This is because 'sms' is a queue of sms to send. So i'd like to keep bilanced initially in this simple way the distribution of sms sent from every client.
Is there a way to accomplish this using only SQL ?
If I join client to delivery to sms ... how to select only ten sms foreach client ?
I'm USING MYSQL with InnoDb