SELECT count vs DELETE JOIN. Why/how are they different? Can someone explain in what way these queries could be different and the results are not the same?  

&gt; begin;
Query OK, 0 rows affected (0.01 sec)  

&gt;select count(*) from tableA a JOIN tableB b ON (a.internal_id = b.internal_id) and a.customer_id=1001;
+----------+
| count(*) |
+----------+
|    23666 |
+----------+
1 row in set (0.20 sec)   

&gt;delete b.* from tableA a JOIN tableB b ON (a.internal_id = b.internal_id) and a.customer_id=1001;
Query OK, 23649 rows affected (0.74 sec)  


Can someone please explain why the delete shows a different number of rows than the count? I am using the same join. Are they not equivalent?
The reason the count differs is due to multiple rows being present in tableA that have a foreign key reference to the same row in tableB.  

When using an inner join the SELECT produces a separate row for each of the records in tableA.  The DELETE statement is only affects tableB.  As mentioned in ypercube's comment, if you were to do a distinct count, the numbers would match.