трям SELECT date sum click as sumc FROM schema stats where stats schem

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
трям
SELECT *, date, sum(click) as sumc FROM `schema`, stats where stats.schemaid = 17 and stats.userid=schema.userid and click>0 group by date order by date DESC
вот запрос на колво кликов
210802 (13:41:12 14/05/2009)
function GetUserStatsShemaByDate($schemaid, $date) {
$query = $this->db->query("SELECT *, date, sum(click) as sumc FROM stats, `schema`, _keys_
where stats.userid=schema.userid and stats.schemaid = $schemaid and _keys_.id=stats.keyid and date = '$date' and click>0 group by searchkey");
return $query->result_array();
}
а это подробное по дате
210802 (13:42:15 14/05/2009)
и не пойму почему общее не верно