2008年6月25日 星期三

搜尋新增一行完成SQL

$sql = "INSERT INTO wap_publish (member_id, headline, style, content_xml, link_url, modify_time, create_time, wap_id, expire_time)
select member_id, headline, style, content_xml, link_url, now(), now(), wap_id, $變數 from wap_content where wap_id = $變數";

//統計貼紙計算 前一天資料
$sql = "INSERT INTO blog_page_view.pv_sticker ( `sticker_id` , `no` , `pv_date` , `pv`) SELECT st.id , s.sticker, (CURDATE( ) - INTERVAL 1 DAY ) as pv_date , COUNT( s.sticker ) AS C
FROM blog_db.`station` s LEFT JOIN blog_adm.sticker st ON s.sticker = st.no
WHERE s.sticker !=0 GROUP BY s.sticker";

【下列文章您可能也有興趣】

沒有留言: