Here is the sql code: "SELECT sum( P.Premium ) AS soweto, sum( T.Premium ) AS `NW meretele`
FROM production P, production T
WHERE P.`Agent Code`
LIKE '%GB01%' AND T.`Agent Code`
LIKE '%WW02%'"
when I execute this query it gets the sum(premium) for P but then multiplies it with the count of %WW02% agents in table production.
Has anybody ever encountered the same problem.
The sum(premium) for the first select is 1470, then the count of occurences of WW02 = 28, 1470*28 = 41160. The answer I am looking for is the 1470 but the aswen I am getting is 41160??
thanks
FROM production P, production T
WHERE P.`Agent Code`
LIKE '%GB01%' AND T.`Agent Code`
LIKE '%WW02%'"
when I execute this query it gets the sum(premium) for P but then multiplies it with the count of %WW02% agents in table production.
Has anybody ever encountered the same problem.
The sum(premium) for the first select is 1470, then the count of occurences of WW02 = 28, 1470*28 = 41160. The answer I am looking for is the 1470 but the aswen I am getting is 41160??
thanks