SQL problemer - Looper 10 gange
Hej, jeg er ved at hive data ud fra flere tabeller, men det er som om at den looper med det antal ordre som nu findes i det statement.mysql> SELECT SUM(unique_clicks) AS u, SUM(raw_clicks) AS r,COUNT(commision_id) AS total_orders FROM sbs_hits,sbs_commisions WHERE sbs_hits.aff_id='50' AND sbs_hits.scheme_id='11' AND sbs_hits.date LIKE '2007-03-21' AND sbs_commisions.order_date LIKE '2007-03-21%' AND sbs_commisions.aff_id='50' AND sbs_commisions.scheme_id='11';
+-------+-------+--------------+
| u | r | total_orders |
+-------+-------+--------------+
| 70080 | 39210 | 20 |
+-------+-------+--------------+
1 row in set (0.00 sec)
Det rigtige output skulle være,
+-------+-------+--------------+
| u | r | total_orders |
+-------+-------+--------------+
| 7008 | 3921 | 10 |
+-------+-------+--------------+