SELECT sr.*,pm.paid
FROM `sales_report` as sr
INNER JOIN `payments` as pm
ON sr.`agent_id`=pm.`agent_id`
ORDER BY sr.date, pm.date
Získáte datum od prvního stolu a objednávejte do 1. data stolu a poté do 2. data stolu.
SELECT sr.*,pm.paid
FROM `sales_report` as sr
INNER JOIN `payments` as pm
ON sr.`agent_id`=pm.`agent_id`
ORDER BY sr.date, pm.date
Získáte datum od prvního stolu a objednávejte do 1. data stolu a poté do 2. data stolu.