I have a table like that
and looking for a result like this, where the last modification date of a particular identifier is indicated, as well as if the check is 1. Here the identifier 6 is not in the result because the check is 0, so 1 is ignored because the check is 0, so the 9/4/19 entry is displayed in the result.
Then the number of children. it counts the number of times, the parent id is repeated. I really do not want the number of times, the parent id is repeated, but I just want to know if he has a child or not.
I do not understand how to count children. Remaining I did like that
SELECT id, modified, checks FROM (selects * in the test order by desc modified) as t1 where checks! = 0 group by (id)
and I had this result
How to make sure that children count too or just if the id has a child?
How to get a result like this