-- ## 5: anonymous様カウンター ## -- -- ページごとの訪問履歴です。weekbuildの分は除いてあります。 -- [browser:trunk/counterplugin Counterプラグイン]っていうのを使ってカウントしてますが、アドホックなつくりなので未公開です。 select name, sum(case targetdate when strftime('%%Y%%m%%d','now') then countnum else 0 end) || '' as '今日', sum(case targetdate when strftime('%%Y%%m%%d','now','-1 Days') then countnum else 0 end) || '' as '昨日', sum(case targetdate when strftime('%%Y%%m%%d','now','-2 Days') then countnum else 0 end) || '' as '2日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-3 Days') then countnum else 0 end) || '' as '3日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-4 Days') then countnum else 0 end) || '' as '4日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-5 Days') then countnum else 0 end) || '' as '5日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-6 Days') then countnum else 0 end) || '' as '6日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-7 Days') then countnum else 0 end) || '' as '7日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-8 Days') then countnum else 0 end) || '' as '8日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-9 Days') then countnum else 0 end) || '' as '9日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-10 Days') then countnum else 0 end) || '' as '10日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-11 Days') then countnum else 0 end) || '' as '11日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-12 Days') then countnum else 0 end) || '' as '12日前', sum(case targetdate when strftime('%%Y%%m%%d','now','-13 Days') then countnum else 0 end) || '' as '13日前', sum(countnum) || '' as '累計(2006/05/03~)' from counter where targetdate > '20060503' group by name