I know that the wording of the question sounds strange, but I could not in another way.
There is something like a query that looks for all elders, parents and childs.
SELECT `elders`.* FROM `elders` LEFT JOIN `parents` ON `elders`.`col` = `parents`.`elders_col` LEFT JOIN `childs` ON `parents`.`col` = `childs`.`parents_col` because using yii2, using the constructor looks like this:
$model = Elders::find()->joinWith('parents.childs')->asArray()->all(); I also need to find all elders who may have a connection with parents, but parents cannot have a childs.
Help formulate such a request.