How can I dynamically add a row count column to the following select statement based on results criteria - for example:
Query:
SELECT
table1.name,
table1.address,
table1.job,
table2.birthday
FROM
table1
INNER JOIN table2 ON table1.userid = table2.userid
WHERE
table2.job = "Doctor"
Intended Results:
The dynamic count is counting the returned rows based on the birthday - if the birthday is different the count resets to 1 and counts.
If it is not possible in mySQL, please note I will be executing this statement in PDO, is there a way to add a dynamic count afterwards? Perhaps using PHP.