SQL语句如下:
SELECT DD.SumHits, AA.CountArt, CC.WeekUpdate, BB.RegUserNum
FROM
(SELECT COUNT(newsid) AS CountArt FROM article) AA,
(SELECT COUNT(id) AS RegUserNum FROM Admin) BB,
(SELECT COUNT(newsid) AS WeekUpdate FROM(article) WHERE DateDiff('ww', DateAndTime, Now()) >= 7) CC,
(SELECT SUM(hits) AS SumHits FROM Article) DD
运行环境:
VS.Net 2003
用OleDbConnection控件
其中用到了子表,因为分开来写不太方便
参考网址:http://www.nbxw.com/study