1. 程式人生 > >dede如何用SQL語句統計某個欄目的文章總數?

dede如何用SQL語句統計某個欄目的文章總數?

dede用SQL語句統計文章總數
1、共有文章:** 篇 {dede:sql sql="select count(*) as c from dede_archives where channel=1"}·共有文章:[field:c /]篇{/dede:sql}
2、共有圖集:** 個 {dede:sql sql="select count(*) as c from dede_archives where channel=2"}·共有圖集:[field:c /]個{/dede:sql}
3、共有軟體:** 個 {dede:sql sql="select count(*) as c from dede_archives where channel=3"}·共有軟體:[field:c /]個{/dede:sql}

4、共有評論:**條 {dede:sql sql="select count(*) as c from dede_feedback"}·共有評論:[field:c /]條{/dede:sql}
5、共有會員:**名 {dede:sql sql="select count(mid) as c from dede_member "}·共有會員:[field:c /]名{/dede:sql}
6、文章閱讀:** 人次 {dede:sql sql="select sum(click) as c from dede_archives"}文章閱讀:[field:c /]人次{/dede:sql}
7、今日更新:**篇 {dede:sql sql="SELECT count( * ) AS c FROM dede_archives WHERE pubdate > UNIX_TIMESTAMP( CURDATE( ) ) "}今日更新:[field:c /]篇{/dede:sql}

8、總共留言: {dede:sql sql="select count(*) as cc From dede_guestbook"}[field:cc/]{/dede:sql}條