1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Oracle SQL: How to Iterate through child records of a parent table and return data from...

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 25, 2024 às 09:02.

  1. Stack

    Stack Membro Participativo

    Parent Table

    Parent ID Parent Name
    1 Parent A
    2 Parent B

    Child Table

    Parent ID Child ID Status
    1 Child A1 ACTIVE
    1 Child A2 INACTIVE
    2 Child B1 INACTIVE
    2 Child B2 INACTIVE

    How can i write a SQL query(PL/SQL?) so that i return details from the parent table only when ALL the child table child statuses are INACTIVE?

    Expected output

    Parent ID Parent Name
    2 Parent B

    Any suggestions how to solve this in Oracle SQL will help

    Thanks

    Noob in SQL, any suggestions or ideas on how to proceed would help

    Continue reading...

Compartilhe esta Página