select count(*) as total from 'test' 表示查询 'test' 表中的记录总数,并取名为 total
既然是总数,肯定只有一条数据,所以 order by id desc 是多余的。可以去掉。
顺便说下 order by 是排序用的,order by 后面跟字段,意思是,根据那个字段排序,
至于desc 是降序的意思, asc和默认不写都是升序。
最后。你这个是mysql数据库吧,如果是sqlserver数据库应该是
select count(*) as total from [test]