我的SQL查詢是這樣由一排交錯的兩個不同的SQL表,組行
$view = mysql_query ("SELECT domain,count(distinct session_id) as
views FROM `statistik` left join statistik_strippeddomains on
statistik_strippeddomains.id = statistik.strippeddomain WHERE
`angebote_id` = '".(int)$_GET['id']."' and strippeddomain!=1
group by domain having count (distinct session_id) >
".(int)($film_daten['angebote_views']/100)." order
count(distinct session_id$vladd) desc limit 25");
我怎麼能寫其笨型號我感謝所有幫助
http://stackoverflow.com/questions/6024800/codeigniter-table-join http://stackoverflow.com/questions/2975987/codeigniter-how-to-use-where-clause-and-or-clause http://stackoverflow.com/questions/8988268/count-group-by-with-active-record 通過這些問題,我想你會找到你的解決方案。 –