Is this the correct query?
SELECT COUNT(*),outlet_itembarcode.outletcode FROM outlet_itembarcode INNER JOIN outlet_itemproductcode
ON outlet_itembarcode.itemcode = outlet_itemproductcode.itemcode GROUP BY outlet_itembarcode.outletcode;
My intention is to join 2 table which have similar columns and count the total rows for certain code; in this case, the outletcode. I have 14 outletcode in both tables. I want to compare the results with my other temporary table which contain the exact total of rows for each outletcode. This 2 tables are a separation from the original temp table where one with barcode and another with productcode only. This should be accurate since the rule is if the data have the barcode it will not contain the productcode and vice versa. I did run this query but it seems that the results is not accurate. I'm using SQLyog on MySQL 4.1.