select a,b from 表名 group by a,b order by count(*) desc

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 20:06:08

select a,b from 表名 group by a,b order by count(*) desc
select a,b from 表名 group by a,b order by count(*) desc

select a,b from 表名 group by a,b order by count(*) desc
把表按a,b两个字段分组进行查询后,再按每组重复记录个数由大到小排序输出.
如果显示字段加上count(*),按以下的语句查询就看的更清楚了.
select a,b,count(*) from 表名 group by a,b order by count(*) desc;

select a,b from 表名 group by a,b order by count(*) desc select * from a union select * from b 能详细说下么 select * into b from a where 11 select ** from A where A.id in (select id from B where ****) 在以下哪种情况,select ** from A whereselect ** from A where A.id in (select id from B where ****) 在以下哪种情况,此语句执行的速度快:(1)A表的记录数远多于 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表的数据 用下列输出回答问题(使用的 E M P表):E N A M E- - - - - - - - - -S M I T H - d o g –A L L E N - d o g –下列哪个S Q L语句产生以上输出?A.select trim(trailing '-dog' from ename) as ename from emp;B.select rpad(ename,10,' insert into a select * from b 和select * into a from b 这两个语句是不是一样的? 求教一个mysql语句 select a.column1,tmp.column1 from a ,(select * from b where ...) where ...求教一个mysql语句select a.column1,tmp.column1 from a ,(select * from b where ...) as tmp where ...tmp相当于从另一个表查询出的结果建 select c.*,d* from ( select 图号 from ( SELECT a.*,b.存货编码 FROM 未明图号 as a left OUTER JOIN 存select c.*,d* from ( select 图号 from (SELECT a.*,b.存货编码FROM 未明图号 as a left OUTER JOIN 存货档案 as bON a.图号=b.规 Oracle中有两个表T1和T2,结构相同.且T1中的数据和T2中的数据互不交叉,则select * from T1 union select * from T2 与 select * from T1 union all select * from T2 的结果( )A.一定完全相同.B.结果一定相同,只是顺 列名acct_month ,acct_year,表名acct_vouch查询最大、小月,最小月要对应最小年select min(acct_month) as start_month from acct_vouch where acct_year=(select min(acct_year) from acct_vouch) select max(acct_month) as cur_month from acct_ select from 表 和select from [表]有什么不同? select * from tablename t 表名后面 t 有什么含义 $query = mysql_query( select * from 表名 where id='$_GET[id]' )中'$_GET[id]'是什么意思? SELECT MAX(account) AS account FROM shop 和 SELECT MAX(account) FROM shop 的区别?shop 是表名,article 是表中的一个字段名. PLSQL中复制表select * into b from a where 11这句话中where 11在这里怎么理解 HQL 的语法:select a from a where a=3 or select b from b whereb=2 要怎么写? select 表列名1 into :变量名1 from 表名 where 表列名1=:变量名2; 这个语句怎么解释?