《sql server 入门经典》 p126页实例5.1的问题
发表在Oracle视频答疑
2015-02-05
是否精华
是
否
版块置顶:
是
否
use db_2008
select * from employee;
with agereps(age,agecount) as
(
[font color=#FF0000]select age,COUNT(*)
from employee as agereports[/font]
where age is not null
group by age
)
select age,agecount
from agereps reps;
这里的with语句是不是快速建表的一种方式,另外标红部分的 as agereports有什么用,好像不是字段名也不是表名,谢谢
select * from employee;
with agereps(age,agecount) as
(
[font color=#FF0000]select age,COUNT(*)
from employee as agereports[/font]
where age is not null
group by age
)
select age,agecount
from agereps reps;
这里的with语句是不是快速建表的一种方式,另外标红部分的 as agereports有什么用,好像不是字段名也不是表名,谢谢