- 情感问答
- 答案列表
sql 查询总数:sql查询记录总数[朗读]
selectmonth(日期),sum(金钱)from表groupbymonth(日期),sum(金钱)。
用count(条件)就可以实现,比如说select编号,内容,count(*)as总数from表名groupby编号,内容。
selectcount(*)from表;
selectcount(*)fromusers(你要查询的表名)。
--查看所有数据库:selectnamefromsys.databases--查看当前数据库的所有表的名字selectnamefromsysobjectswherextype='u'andcategory=0xtype可替换为如下参数--。