Count parent rows that have children
Table A has a number of rows, only some of which have (multiple) children in Table B. I need to count the rows in table A that have children.

At the moment I have

    SELECT count(tableA.id) as count
    FROM (tableA)
    JOIN tableB ON tableB.tableA_id = tableA.id

Unfortunately this also counts multiple children from tableB in the count. Is there any way to prevent this?
Count parent rows that have children
===

Table A has a number of rows, only some of which have (multiple) children in Table B. I need to count the rows in table A that have children.

At the moment I have

    SELECT count(tableA.id) as count
    FROM (tableA)
    JOIN tableB ON tableB.tableA_id = tableA.id

Unfortunately this also counts multiple children from tableB in the count. Is there any way to prevent this?