select count(*) as total from 'test' order by id desc 希望得到正解

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/01 17:24:57
selectcount(*)astotalfrom''test''orderbyiddesc希望得到正解selectcount(*)astotalfrom''test''orderbyiddesc希望得到正解

select count(*) as total from 'test' order by id desc 希望得到正解
select count(*) as total from 'test' order by id desc
希望得到正解

select count(*) as total from 'test' order by id desc 希望得到正解
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]

select count和select count的区别 oracle 优化查询效率select t.dwmc,t.zgjl,t.zbjl,t.zqjl,t.xljl,t.skjl,t.bgjl, t.bqjl,t.bgjl2,t.pxjl,t.ccjl, (zbjl+zqjl+xljl+skjl+bgjl+bqjl+bgjl2+pxjl+ccjl) as hz from (select code_mean as dwmc, (select count(*) from tableoneb, tabletwo a w select id from (select id from pedigree group by number having count(name)>1)as a; 为啥用as a select count(*) as total from 'test' order by id desc 希望得到正解 机器上的英文字母是什么意思啊u: unit select key t: lare key n: count select key select count(*)count 什么意思和select * 有什么区别 select count(*) from 怎么使用 select count(1) from emp and select 4718 fromselect count 关于GROUP BY子句SELECT GoodsClassID as 商品类别编号,COUNT(*) as 商品数 FROM Table_GoodsGROUP BY GoodsClassID sql语句的用法:select as-->>select count(*) as count from table;记录总数保存在count中了,在jsp中这个count怎么用呢,也是就说怎样把这个count的值取出来.直接 int c = count;行吗?或者别的 select count(c) from (select b from TUserBankLogSum b group by b.tid) as c 这条hql是错的按照这个意思应该怎么写 $sql=SELECT count(*) as pcount FROM news 和$sql = UPDATE article SET这句是什么意思? com.accp.dao.impl.StudentsDAOImpl@1ba92dbHibernate:select top 2 students0_.id as id0_,students0_.class_id as class2_0_,students0_.name as name0_,students0_.age as age0_ from students students0_ order by students0_.id descHibernate:select count(*) as SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0select * from B where (select count(1) as num from A where A.ID = B.ID) = 0请问如何理解,为什么 可以在B表中 排除A表的数据 MYSQL如何把两个结构相同的表组成一个表查询select * from (select uid,count(*) as sc from `bbs_topics` group by uid) as a,(select uid,count(*) as sc from `bbs_reply` group by uid) as b where a.uid=b.uid我向要取得两个表的数量 关于数据库Oracle的一道题a.course=b.能通俗点解析吗?select courseid as 课程ID,course as 课程名称,nvl(avg(grade),0) as 平均成绩,(select count(grade) from train a where grade sql函数,select count(A.abc) as sum from A left join B on A.id=B.id where A.abc='1' group by A.abc结果是 sum 234怎么求count(A.abc) as sum 的总数.