select A.tid,A.tname,count(b.cid) from teacher A,course b,tcourse C
创新互联专注于企业全网营销推广、网站重做改版、雁山网站定制设计、自适应品牌网站建设、html5、购物商城网站建设、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为雁山等各大城市提供网站开发制作服务。
where A.tid=C.tid
and b.cid=C.cid
group by A.tid,A.tname
order by count(b.cid) desc
select date as "日期",
sum(decode(area,'海淀',value,0)) as "海淀统计数",
sum(decode(area,'朝阳',value,0)) as "朝阳统计数",
sum(value) as "总数"
from a
group by date
create database exam;
grant all privileges on *.* to test@"%" identified by "123456";
use exam;
create table product(id int(4) auto_increment not null , name char(10) not null ,price int(4), sdate date);
insert into product(name,price,sdate) values("计算机",5000,"2006-8-8");