首页 > 试题广场 >

根据题目要求写出sql

[问答题]
在SQL中,一个表的定义如下:
CREATE TABLE t_account(
     account varchar(100),
     account_type TINYTEXT,
     PRIMARY KEY (account),
};
account为账号,account_type为该账号的类型,写出一个sql,统计账号数累计超过5000个账号类型,并显示对应的账号数,即结果中每行是(账号类型,账号数)

推荐
SELECT account_type,COUNT(account_type)
FROM t_account
GROUP BY account_type
HAVING COUNT ( account_type )>5000;

编辑于 2015-04-25 23:05:19 回复(3)
select account_type as 账号类型,count(account) as 账号数 from t_account group by account_type having count(account)>5000
发表于 2015-06-25 14:27:58 回复(0)
select account_type, count(*)
from t_account
group by account_type
having count(*)>5000
发表于 2016-03-22 16:15:20 回复(0)
select account_type 账号类型,count(account)  账号数 from t_account group by account_type having count(account)>5000

发表于 2015-10-06 13:50:05 回复(0)
<div> select &nbsp;account_type count(*) </div> <div> from&nbsp;t_account </div> <div> group by&nbsp;<span>account_type</span> </div> <div> <span>having count(*) &gt; 50000</span> </div>
发表于 2015-09-09 20:53:54 回复(0)
select account_type,count(account) from t_account group by account having count(account)>5000
编辑于 2015-07-28 16:14:59 回复(0)
select  account_type AS 账号类型,count(*)  AS 帐号数 from t_account
group by account_type
having count(*) > 5000

发表于 2015-05-17 13:48:34 回复(0)
select account_type, count(*) from t_account  group by account_type having count(*) > 5000; 
发表于 2015-05-03 21:17:34 回复(0)
select account_type, count(*) from t_account group by account_type having count(*) > 5000
发表于 2015-04-30 15:50:20 回复(0)
select account_type, count(*)
from  t_account
group by account_type
having count(*) > 5000;
发表于 2015-04-30 15:38:07 回复(0)
SELECT account_type, count(*)
FROM t_account
GROUP BY  account_type
HAVING COUNT(*) > 5000;
发表于 2015-04-30 09:48:22 回复(0)
select account_type 账号类型,count(account) 账号数 from t_account group by account_type having count(account)>5000
发表于 2015-04-29 00:30:45 回复(0)
select account_type,count(1) as count from t_account group by account_type having count > 5000;
发表于 2015-04-26 23:03:19 回复(0)

select account_type 帐号类型,count(account) 帐号数 from t_account where account_type in (select account_type from t_account where count(account_type)>5000)

发表于 2015-04-26 17:30:43 回复(0)
select account_type,count(account) from t_account group by account_type having count(account_type)>5000
发表于 2015-04-26 16:12:10 回复(0)
select account_type,count(account) from t_account group by account_type having count(account_type)>5000;
发表于 2015-04-25 22:46:21 回复(0)
select account_type,count(account) from t_account groupby account_type having count(account)>5000;
发表于 2015-04-25 10:03:14 回复(0)
select account_type,count(account_type)
from t_account
group by account_type
having count(account_type)>5000
发表于 2015-04-25 00:46:57 回复(0)
select account_type,count(account_type)
from t_account
group by account
having count(account_type)>5000
发表于 2015-04-25 00:35:48 回复(0)
F@N头像 F@N
select account_type,count(account_type)
from t_account
group by account_type
having count(account_type)>5000
发表于 2015-04-25 00:09:41 回复(0)
SELECT   account_type , count ( account )   FROM   `t_account`   group   by   account_type   HAVING   count ( * )   > 5000
发表于 2015-04-24 23:32:04 回复(0)