get last child post by wp_query

try this

$posts = get_posts([
    "post_type" => "ABCD", // put the custom type here
    "post_parent__not_in" => "0", // parent is not root
]);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)