-- dettool -childlessrun

SELECT DISTINCT
   detRun.*
 FROM detRun
 LEFT JOIN detRun as foo
   ON foo.parent = detRun.det_id
 WHERE
   detRun.state = 'stop'
   AND detRun.mode = 'master'
   AND foo.det_id IS NULL
