Skip to content

query Parent and child table values at a time #279

Open
@ghost

Description

Dialect

MySQL

Failing SQL

SELECT *,
(SELECT COUNT(tableb.tableA_id) FROM TableB WHERE TableB.tableA_id = tablea.id) AS count
FROM TableA tablea;

Description

I have a Parent table and child table with foreign key association. i need to query parent table along with count of each id in child table.

Screenshot 2021-07-25 at 12 26 32 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions