My query is like this….
SELECT tb1.name, COUNT(tb2.payment_date) as first_payment FROM table1 LEFT JOIN table2 tb2 ON tb2.id_user = tb1.id
+-----------+-------------+
| Name | Count |
+-----------+-------------+
| John | 543534543 |
but I wish that my query returns a limit on join, something like:
LEFT JOIN tb2 ON tb2.id_user = tb1.id { LIMIT JOIN }
return only one relationship…..
+-----------+-------------+
| Name | Count |
+-----------+-------------+
| John | 3 |
1 Answer