Hi,
I have query which provide wrong result, am I doing any thig wrong in this query
SELECT b.nBoutiqueID ,
b.sBoutiqueName ,
b.Status ,
SUM(bs.nViewCount) nViewCount ,
SUM(ps.nViewCount) nProductViewCount,
SUM(ps.nLinkClickCount) nLinkClickCount ,
SUM(ps.nWishListCount) nWishListCount ,
SUM(ps.nReferredCount) nReferredCount
FROM boutique b
LEFT JOIN boutique_stats bs
ON b.nBoutiqueID=bs.nBoutiqueID
LEFT JOIN product_stats ps
ON ps.nBoutiqueID=b.nBoutiqueID
WHERE b.bDeleted =0
GROUP BY b.nBoutiqueID
ORDER BY ps.nProductID DESC
Query giving not any error, but producing wrong result. I'm Using Mysql.
For particular Instance for nBoutiqueID=1 the max sum of nViewCount should be 455, but it gives 95124. that is huge difference. any one know why?