您的位置:百味书屋 > 范文大全 > 经典范文 > 你会使用apply吗 正文

你会使用apply吗

2017-04-05 07:07:37 来源网站: 百味书屋

篇一:2016前端面试题第一套含答案

1) 下列哪个样式定义后,内联(非块状)元素可以定义宽度和高度a. display:inline b. display:none c. display:block d. display:inherit2) css 属性 overflow 属性定义溢出元素内容区的内容会如何处理。如果值为 scroll,不论是否需要,用户代理都 会提供一种滚动机制。True False 3) 新窗口打开网页,用到以下哪个值()。a. _self b. _blank c. _top d. _parent 4) 下面有关 jquery 事件的响应,描述错误的是? a. b. c. d. onclick 鼠标点击某个对象 onfocus 元素失去焦点 onload 是某个页面的 css js html 文档结构和图像被完成加载 onmousedown 某个鼠标按键被按下5)元素的 alt 和 title 有什么异同,选出正确的说法?不同的浏览器,表现一样a. alt 和 title 同时设置的时候,alt 作为图片的替代文字出现,title 是图片的解释文字 b. alt 和 title 同时设置的时候,title 作为图片的替代文字出现,alt 是图片的解释文字 c. 以上说法都不正确6) 下列 js 可以让一个 input 的背景颜色变成红色的是?A. inputElement.style.backgroundColor = 'red'; b. inputElement.backgroundColor = 'red'; c. inputElement.style.backgroundColor = '#0000'; d. inputElement.backgroundColor = '#0000';

7) 下面有关 html5 标签说法错误的有? a. <audio> 标签定义声音,比如音乐或其他音频流 b. <canvas> 比如来自一个外部的新闻提供者的一篇新的文章,或者来自 blog 的文本,或者是来自论坛的文本。亦 或是来自其他外部源内容 c. <menu> 标签定义菜单列表。当希望列出表单控件时使用该标签 d. <command> 标签定义命令按钮,比如单选按钮、复选框或按钮 8) 下述有关 css 属性 position 的属性值的描述,说法错误的是? a. b. c. d. static:没有定位,元素出现在正常的流中 fixed:生成绝对定位的元素,相对于父元素进行定位 relative:生成相对定位的元素,相对于元素本身正常位置进行定位。 absolute:生成绝对定位的元素,相对于 static 定位以外的第一个祖先元素进行定位。9) 下面符合一个有效的 javascript 变量定义规则的是? a. b. c. d. _$te$t2 with a bc 2a10) 下面有关 JavaScript 中 call 和 apply 的描述,错误的是? a. b. c. d. call 与 aplly 都属于 Function.prototype 的一个方法,所以每个 function 实例都有 call、apply 属性 两者传递的参数不同,call 函数第一个参数都是要传入给当前对象的对象,apply 不是 apply 传入的是一个参数数组,也就是将多个参数组合成为一个数组传入 call 传入的则是直接的参数列表。call 方法可将一个函数的对象上下文从初始的上下文改变为由 thisObj 指定的新对 象。11) 什么会被打印在控制台上? b 是局部变量还是全局变量(function() { var a = b = 5; })(); console.log(b);12) 执行这段代码,输出什么结果。 function test() { console.log(a); console.log(foo()); var a = 1; function foo() { return 2; } } test();13) 执行这段代码,输出什么结果。 var fullname = 'John Doe'; var obj = { fullname: 'Colin Ihrig',

prop: { fullname: 'Aurelio De Rosa', getFullname: function() { return this.fullname; } } }; console.log(obj.prop.getFullname()); var test = obj.prop.getFullname; console.log(test()); 14) 下面这个 JS 程序的输出是什么: function Foo() { var i = 0; return function() { console.log(i++); } } var f1 = Foo(), f2 = Foo(); f1(); f1(); f2(); 15) 下面这个 JS 程序的输出是什么:<SCRIPT LANGUAGE="JavaScript"> var bb = 1; function aa(bb) { bb = 2; alert(bb); }; aa(bb); alert(bb); </SCRIPT>16) Doctype 作用? 严格模式与混杂模式-如何触发这两种模式,区分它们有何意义? 17) CSS 选择符有哪些?哪些属性可以继承?优先级算法如何计算? CSS3 新增伪类有那些? 18) 谈谈 This 对象的理解。 19)请用js 实现全选和取消全选的功能,只需要写出 js 代码(可以使用 jquery 框架)<input type=”checkbox” id=”checkall” />全选 <div class=”list”> <input type=”checkbox” name=” type” value=”1” /> 这是 1

<input type=”checkbox” name=”type” value=”2” /> 这是 2 </div>20)面试官问你有没有女/男朋友?答案 1,C。内联元素加上 display:block;后被块级化。块级元素一般是其他元素的容器, 可容纳内联元素和其他块状元素, 块状元素排斥其他元素与其位于同一行,宽度(width)高度(height)起作用。因此,可以定义其宽度和高度。 ,2,TRUE。参数是 scroll 时候,必会出现滚动条。 参数是 auto 时候,子元素内容大于父元素时出现滚动条。 参数是 visible 时候,溢出的内容出现在父元素之外。 参数是 hidden 时候,溢出隐藏。, 3,选 B。在 html 中通过<a>标签打开一个链接,通过 <a> 标签的 target 属性规定在何处打开链接文档。 如果在标签<a>中写入 target 属性,则浏览器会根据 target 的属性值去打开与其命名或名称相符的 框架<frame>或 者窗口. 在 target 中还存在四个保留的属性值如下, 属性值 值 描述_blank在新窗口中打开被链接文档。_self默认。在相同的框架中打开被链接文档。_parent在父框架集中打开被链接文档。_top在整个窗口中打开被链接文档。framename在指定的框架中打开被链接文档。4,选 b。onfocus 获得焦点 onblur 失去焦点

5,A 这两个属性是有些重复了。在不同浏览器里面表现有些不同。在 alt 和 title 同时设置的时候,alt 作为图片的替 代文字出现,title 是图片的解释文字。 6,A #0000 是不正确的写法,至少要为六位,应该是#FF0000 A 写法是正确的,有两种写法: document.getElementById("input").style.backgroundColor = "red"; inputElement.style.backgroundColor = "#FF0000"; 7, B 这里考察 HTML 标签的使用: <audio> 标签定义声音,比如音乐或其他音频流。 A 正确。 <canvas> 标签定义图形,比如图表和其他图像。<canvas> 标签只是图形容器,您必须使用脚本来绘制图形。 B 错误, <article>标签定义外部的内容。比如来自一个外部的新闻提供者的一篇新的文章,或者来自 blog 的文本,或者是来 自论坛的文本。亦或是来自其他外部源内容。 <menu> 标签定义命令的列表或菜单。<menu> 标签用于上下文菜单、工具栏以及用于列出表单控件和命令。 C 正确 command 元素表示用户能够调用的命令。<command> 标签可以定义命令按钮,比如单选按钮、复选框或按钮。只有当 command 元素位于 menu 元素内时,该元素才是可见的。否则不会显示这个元素,但是可以用它规定键盘快捷键。 D 正确。 8,B static 元素框正常生成。块级元素生成一个矩形框,作为文档流的一部分,行内元素则会创建一个或多个行框,置于其父元 素中。 relative 元素框偏移某个距离。元素仍保持其未定位前的形状,它原本所占的空间仍保留。 absolute 元素框从文档流完全删除,并相对于其包含块定位。包含块可能是文档中的另一个元素或者是初始包含块。元素原 先在正常文档流中所占的空间会关闭,就好像元素原来不存在一样。元素定位后生成一个块级框,而不论原来它在正常流 中生成何种类型的框。 fixed 元素框的表现类似于将 position 设置为 absolute,不过其包含块是视窗本身。 9,A 正确; B 是关键字; C 有空格; D 开头为数字; 第一个字符必须是一个 ASCII 字母(大小写均可),或一个下划线(_)。注意第一个字符不能是数字。 后续的字符必须是字母、数字或下划线。 变量名称一定不能是 保留字。 10,B; call()方法和 apply()方法的作用相同,他们的区别在于接收参数的方式不同。对于 call(),第一个参数是 this 值没有变化,变化的是其余参数都直接传递给函数。(在使用 call()方法时,传递给函数的参数必须逐个列举出来。 使用 apply()时,传递给函数的是参数数组)如下代码做出解释:function add(c, d){ return this.a + this.b + c + d; }

篇二:必修5unit5学案

2012—2013学年度高二英语必修5—Unit5 学案

1. aid:

1) v. aid sb. to do sth. (用法同assist)

aid sb. in doing/with sth.

I aided her to continue her study.

=I aided her in continuing her study.

=I aided her with her study.

2) n. first aid 急救 a hearing aid 助听器

with the aid of/with sb’s aid 在?的帮助下

in aid of 用以援助...; 作为援助...之用

eg. collect money in aid of the poor

come /go to sb.’s aid 前来/去援助某人

give/ offer aid to sb. 给予帮助

2. temporary 临时的;暂时的反义词:permanent adj.永久的,持久的

Eg He suffered a temporary loss of memory 暂时的失忆

temporary agreement 临时协议 temporary workers 临时工人

译:The boss had to hire some _____________ (临时工) to do some______________ (临时工作).

3.. fall ill=become ill 生病

用法:此处fall为系动词,非延续性动词;若与时间段连用,要用be ill。

联想:fall asleep睡着fall silent变得沉默

Complete the following sentences

⑴他因总是想家而病倒了。 ____________because of his homesickness. He fell ill

⑵他直到午夜才睡着。 ___________________ until midnight. He didn’t fall asleep

(3)他一到那里就病倒了。No sooner had he arrived there than ____ __.he fell ill

(4)His wife suddenly ______last week.

(5 )He __________ for a week.

4. .injury (c./u.)n( 身体;感情;名誉)injure( v.)injured (adj)

搭配:

be an injury to 伤害..., 危害..., 对...有害

do sb. an injury/do an injury to sb.伤害某人

to suffer injuries to the head 头部受伤

eg He suffered severe injury to his leg.

a leg injury一处腿伤 an injury to one’s reputation损毁?的名誉

⑴ He ___________ (injure) in an accident. was injured

⑵ He escaped from the train wreck without ________ (injure).injury

5 bleed 流血v bleeding 流血 n 出血的adj. blood n. bloody adj 血腥的

bleed patient 给病人抽血

blood pressure 血压 blood test 验血 blood type 血型 brother by blood 亲兄弟

Blood is thicker than water.血浓于水。

Blood circulates through the body.血液在人体内循环

6 essential adj. basic, necessary 最重要的 essentials n. (pl.) 必需品; 要素,要点

Food is essential to life.食物是维持生命不可或缺的

Personal space is essential for healthy living. (拥有)个人空间是健康生活所必需的。 the essentials of grammar 语法要点essentials/necessities of life 生活必需品

7 organ n. 器官

The eyes are the organs of sight. 眼睛是视觉器官.

The liver is an organ and so is the heart. 肝脏是一个器官,心脏也是。

state organs国家机构

organic adj. 器官的, 有机的, 组织的 organic vegetables 有机肥料灌溉的蔬菜 8 layer: 层层次

a depth or level 深度或层次 a poem with several layers of meaning.有多层含义的歌a layer of dust on the windowsill窗台上的一层灰尘 a cake with four layers 四层蛋糕 9 barrier 屏障障碍

搭配:

build/form/set up a barrier 设置障碍 remove/break down a barrier 消除障碍

overcome a barrier 越过障碍 artificial barrier 人为的障碍 cultural barriers 文化障碍 social barriers 社会的障碍 language barriers 语言障碍

10 poison 毒药n. 使中毒v poisonous adj 有毒的

⑴ It’s time that________ (poison) TV plays should be forbidden to play. Poisonous ⑵ He tried to kill himself by________ (服毒).taking poison

⑶ Gases from cars___________ (正在污染) the air of our cities. are poisoning

11.ray n. 光线射线

Eg My eyes are blind by the direct ray of light. 在光线的直射下,我看不清楚东西。

搭配:focus a ray 聚光reflect rays 反射光线shut out rays 遮住光a ray of 一束?,一线 a ray of hope 一线希望 a ray of light 一道亮光

12 complexadj 复杂的 n. 综合体

It was a complex problem

complex idea 复杂的观念 complex machines 结构复杂的机器complex sentence 复合句 complex networks of roads 错综复杂的公路网complex situation 复杂的情况

building complex 综合建筑laboratory complex 综合实验室 shopping complex 综合商场 sports complex 综合体育场

13 variety n. 变化;多样性;各类vary v. 不同 various adj. 不同的 variously adv. 不同地 a variety of/varieties of各种各样的

1).The shopping-centre sells __________ goods.这个购物中心出售各种商品。 a variety of

2).Everyone arrived late at the party for__________reasons.由于种种原因,每个人赴会都迟到了。

various

3).Beijing is filled with people from __________ of China.北京充满着来自全国各地的人。 various parts

4) More and more people choose to shop in a supermarket as it offers a great__________of goods.

A.variety B.mixtureC.extension D.combination

14. liquid 液体 solid 固体 gas 气体

15 radiation 辐射

radiationless 非辐射的 radiation proof 防辐射的

16 mild adj 轻微的温和的

Eg He has a mild nature 性格温和

a mild person. 性情温和的人 a mild punishment.轻微的惩罚 mild weather/climate温和的天气/气候

17 heal vt., vi. 治愈(伤口);使复原

The wound soon healed up / over. Time is a great healer.(谚)

heal sb. of sth

He was healed of his sickness.他病已痊愈。

Time heals all sorrows. 时间会治愈一切忧伤。

treat “治疗”,着重强调过程,不涉及结果,不一定治愈。

heal 多用于治疗外伤。

cure “治愈”,强调结果。

用cure healtreat 填空

①The wounds were gradually _____ (up). healing

②This helps to _________ the broken bone. heal

③He is being_________ for a rare skin disease. treated

④At one time the doctors couldn't _________ people of SARS. cure

treat 用法

The stepmother treated her very badly. 对待

Please treat everything I said as a joke.看作

I’ll treat you all to dinner.请客

18. swell vi.&vt. (swelled ,swelled/swollen) 使膨胀隆起

Her leg has swollen badly The wind swelled the sails.风鼓起了帆。

The heavy rain swelled the river 大雨使河水上涨了。

swollen可作形容词,表示“肿胀的”

Her eyes were red and swollen with weeping.

Have a swelled/swollen head (指因突然成功)冲昏头脑

19 squeeze out 榨出,挤出

squeeze out榨出;挤出

They have been squeezed out of the job market by young people.他们被年轻人挤出了就业市场 squeeze...out of/from...把??从??中榨出来

squeeze money from sb 向某人勒索钱财

squeeze money out of sb

The young man often squeezes money from/ out of the pupil.那个年轻人经常向那个小学生勒索钱财。

squeeze into/through...挤进??

complete the following sentences

(1)Must you__________________________ (挤牙膏)in the middle?

(2)Try to ____________________(再挤出一点儿) out of the tube.

(3)Five of us ________________________________(挤进了汽车的后座).

(1)squeeze the toothpaste tube (2)squeeze a bit more (3)squeezed into the back seat of the car

(4 )She squeezed some juice______ the lemon.out

(5) He squeezed________ the crowd and then went up to the stage. into/through

(6 )The elevator was full,but I managed to squeeze ____.in

(7 )He squeezed everything______ the suitcase.(into)

(8) Those outdated products were squeezed __________ the market. out of

20 in place 在适当的位置

In place 在适当的位置,适当out of place 不在适当的位置,不适当

in place of代替take the place of代替 take place 发生

complete the following sentences

(1)________________________ (把绷带固定在合适的地方)with tape.

(2)__________________(一切准备就绪),she started the slide show.

(3)I like everything ______________(都放在原来的地方).

答案:(1)Hold the bandage in place (2)With everything in place (3)to be in place

(4 )She likes everything _______________ before she starts work.一切都都在适当的位置 to be in place

(5 )Her criticisms were quite_____________. ( 她的批评太不相宜了)out of place

21 pour 倾泻

1) pour down 倾倒 pour out 倒出倾诉 pour sth on sb 把?倒到?上 pour into 涌入 The rain is pouring down.雨泻下如注。

It was pouring down nonstop.当时正在不停地下雨。

⑴有些学生常常向我们的心理老师吐露他们的烦恼。

Some students often pour_____ their trouble ___ our psychology teachers. out/to

⑵有些人总是爱给别人的计划泼冷水。

Some people are always________________ others’ plan. pouring cold water on

22 apply 应用申请运用 application 申请书

apply A to B apply to 适用于apply for sth. 申请 apply to sb.for sth.

apply oneself to...专心于?? make an application to sb.for sth.向某人申请某物

⑴我们应当把理论运用到实践中去,要不然,这条理论是无用的。

We should_________________________,otherwise,it is no use. apply theory to practice ⑵这项规则不是所有情况都使用This rule doesn’t ___________ every case. apply to ⑶不要向经理申请这份工作,那工作太无聊了。apply to/make an application to / for Don’t____________________________ the manager____the job,because it is boring.

(4)I ____________________________ (申请了4所大学)and was accepted by all of them.

(5)The questions on this part of the form ________________________(只适用于已婚男士).

(6)He would do very well __________________________(只要专心致志).

(7)This new technology ____________________________(已运用于农业).

(8)She __________ __________ a job__________an English teacher.她应征英语教师的工作。 applied for;as

(9).Peter has been out of work for half a year,so he wants to__________a job in this company.

A.prepare for B.apply for C.superior to D.object to

applied to four universities (2)only apply to married men (3)only if he applied himself to it

(4)has been applied to agriculture

23 make a difference有影响起作用

make a difference 区别对待;有影响;起(重要)作用

make no difference (to sb./sth.) 对某人/物没有作用或影响,对某人/物不重要、不要紧 make some difference (to sb./sth.) 对某人/物有些作用或影响

tell the difference分辨,区分,区别

complete the following sentences

(1)It ______________________ (会有很大不同)which way he goes.

(2)Whether he will come ________________(无关紧要).

(3)The twins are so alike,it’s ________________________(很难区分).

(4)The rain ____________________________(对比赛没有什么影响).

(5 )下不下雨对我来说都一样。Whether it rains or notmakes no difference to me

(6) 这次的旅行将会对他以后的生活有很大的影响。

The travel will______________________ to his later life. make a great difference

(7) 努力点吧,你会与众不同的。Work hard, ________________________.and you will make a difference

(1)makes a great difference (2)makes no difference(3)difficult to tell the difference (4)made no difference to the game

24 present n. =giftpresent adj.现在的在场的 presence 在场出现present v. 递交,呈现 be present at 在场出席at present =at the present time

The book was a present from my brother.

Were you ~ when the news was announced?宣布那消息时你在场吗?

200 people were present at the meeting yesterday. 昨天有200人到会。

The mistake was obvious to all present. 所有在场者一眼就看出那个错误。

The present problem is where to buy such materials. 目前的问题是到哪儿去买这样的材料。 I’m afraid I can’t help you at present — I’m too busy. 很抱歉,我现在帮不了你—实在太忙了。

. ~sb with sth ~ sth to sb

They presented a sum of money to the college in memory of their son.

他们向学院赠送了一笔款项以纪念他们的儿子。

He presented the report to his colleagues at the meeting.

用present 适当形式填空

1. The mistake was obvious to all ________.present

2. This digital camera would make an excellent ________ for Christmas.present

3. The famous scientist _________ himself at the conference last month. presented

4. We are concerned about the ________ condition of the schools in the countryside. present

5. The committee is _________ its report to the public next week.presenting

短语

1生病fall ill2充当act as 3 阻止?做?prevent?(from) doing... 4触觉sense of touch 5多种多样的a variety of 6一、两天之内within a day or two 7把---同--粘着stick?to? 8挤出squeeze out 9反复over and over again 10在适当的位置in place 11如果可能的话if possible12 坐立,熬夜sit/stay up 13 撞翻knock over14 被授予?be presented\honoured with?

15 大量a number of 16 流血不止bleed heavily 17 砍断,切断(供应等) cut off 18找到put one's hands on 19把..应用到.. apply sth to sth

20有?方面的知识. Have/ acquire a knowledge of ---

21起重要作用make a difference 22参加一场特殊的招待会attend a special reception

1-10 Injury, treatment, bleeding, pressure, ceremony, ambulances, injured, bravery, bandage, mild

篇三:SQL - Apply运算符用法

使用 APPLY

APPLY 运算符的左操作数和右操作数都是表表达式。这些操作数之间的主要区别是,right_table_source 可以使用表值函数,从 left_table_source 获取一个列作为函数的参数之一。left_table_source 可以包括表值函数,但不能以来自 right_table_source 的列作为参数。

APPLY 运算符通过以下方式工作,以便为 FROM 子句生成表源:

1. 对 left_table_source 的每行计算 right_table_source 的值来生成

行集。

right_table_source 中的值依赖于 left_table_source。

right_table_source 可以按以下方式近似表示:

TVF(left_table_source.row),其中,TVF 是表值函数。

2. 通过执行 UNION ALL 操作,将计算 right_table_source 的值时为每

行生成的结果集与 left_table_source 组合起来。

APPLY 运算符的结果生成的列的列表是来自 left_table_source(与来自 right_table_source 的列的列表相组合)的一组列。

SQL Server 2008 联机丛书

使用 APPLY

值函数。表值函数作为右输入,外部表表达式作为左输入。通过对右输入求值来获得左输入每一行的计算结果,生成的行被组合起来作为最终输出。APPLY 运

返回外部表中通过表值函数生成结果集的行。OUTER APPLY 既返回生成结果集的行,也返回不生成结果集的行,其中表值函数生成的列中的值为 NULL。 例如,考虑下列表 Employees 和 Departments:

--Create Employees table and insert values.

CREATE TABLE Employees

(

empidintNOT NULL

,mgridintNULL

,empname varchar(25) NOT NULL

,salary money NOT NULL

CONSTRAINT PK_Employees PRIMARY KEY(empid)

);

GO

INSERT INTO Employees VALUES(1 , NULL, 'Nancy', $10000.00); INSERT INTO Employees VALUES(2 , 1, 'Andrew' , $5000.00); INSERT INTO Employees VALUES(3 , 1, 'Janet', $5000.00); INSERT INTO Employees VALUES(4 , 1, 'Margaret', $5000.00); INSERT INTO Employees VALUES(5 , 2, 'Steven' , $2500.00); INSERT INTO Employees VALUES(6 , 2, 'Michael' , $2500.00); INSERT INTO Employees VALUES(7 , 3, 'Robert' , $2500.00); INSERT INTO Employees VALUES(8 , 3, 'Laura', $2500.00); INSERT INTO Employees VALUES(9 , 3, 'Ann' , $2500.00); INSERT INTO Employees VALUES(10, 4, 'Ina' , $2500.00); INSERT INTO Employees VALUES(11, 7, 'David', $2000.00); INSERT INTO Employees VALUES(12, 7, 'Ron' , $2000.00); INSERT INTO Employees VALUES(13, 7, 'Dan' , $2000.00); INSERT INTO Employees VALUES(14, 11 , 'James', $1500.00); GO

--Create Departments table and insert values.

CREATE TABLE Departments

(

deptid INT NOT NULL PRIMARY KEY

,deptname VARCHAR(25) NOT NULL

,deptmgrid INT NULL REFERENCES Employees

);

GO

INSERT INTO Departments VALUES(1, 'HR', 2);

INSERT INTO Departments VALUES(2, 'Marketing', 7);

INSERT INTO Departments VALUES(3, 'Finance',8);

INSERT INTO Departments VALUES(4, 'R&D', 9);

INSERT INTO Departments VALUES(5, 'Training', 4);

INSERT INTO Departments VALUES(6, 'Gardening', NULL);

Departments 表中的多数部门都具有一个经理 ID,这些 ID 与 Employees 表中的雇员相对应。以下表值函数接受雇员 ID 作为参数,并返回该雇员和他/她的所有下属。

CREATE FUNCTION dbo.fn_getsubtree(@empid AS INT)

RETURNS @TREE TABLE

(

empidINT NOT NULL

,empname VARCHAR(25) NOT NULL

,mgridINT NULL

,lvl INT NOT NULL

)

AS

BEGIN

WITH Employees_Subtree(empid, empname, mgrid, lvl)

AS

(

-- Anchor Member (AM)

SELECT empid, empname, mgrid, 0

FROM Employees

WHERE empid = @empid

UNION all

-- Recursive Member (RM)

SELECT e.empid, e.empname, e.mgrid, es.lvl+1

FROM Employees AS e

JOIN Employees_Subtree AS es

ON e.mgrid = es.empid;

)

INSERT INTO @TREE

SELECT * FROM Employees_Subtree;

RETURN

END

GO

若要返回每个部门经理的各级下属,请使用以下查询。

SELECT D.deptid, D.deptname, D.deptmgrid

,ST.empid, ST.empname, ST.mgrid

FROM Departments AS D

CROSS APPLY fn_getsubtree(D.deptmgrid) AS ST;

下面是结果集:

deptiddeptnamedeptmgridempid empname mgrid lvl ----------- ---------- ----------- ----------- ---------- ----------- ---

1 HR2 2 Andrew 1 0 1 HR2 5 Steven 2 1 1 HR2 6 Michael 2 1 2 Marketing 7 7 Robert 3 0 2 Marketing 7 11 David7 1 2 Marketing 7 12 Ron 7 1 2 Marketing 7 13 Dan 7 1 2 Marketing 7 14 James11 2 3 Finance 8 8 Laura3 0 4 R&D 9 9 Ann 3 0 5 Training4 4 Margaret1 0 5 Training4 10 Ina 4 1 注意,Departments 表中每一行复制的次数与针对部门经理执行

fn_getsubtree 而返回的行数相同。

另外,结果中不显示 Gardening 部门。因为该部门没有经理,所以

fn_getsubtree 将针对该部门返回空集。通过使用 OUTER APPLY,Gardening 部门也将在结果集中显示,其 deptmgrid 字段以及由

fn_getsubtree 返回的字段中的值都为空值。

请参阅

其他资源

FROM (Transact-SQL)


你会使用apply吗》出自:百味书屋
链接地址:http://www.850500.com/news/120694.html
转载请保留,谢谢!
查看更多相关内容>>你会使用apply吗
相关文章
  • 你会使用apply吗

    SQL-Apply运算符用法使用APPLYAPPLY运算符的左操作数和右操作数都是表表达式。这些操作数之间的主要区别是,right_table_source可以使用表值函数,从left_table_source获取一个列...

  • 你会使用apply吗

    2016前端面试题第一套含答案1)下列哪个样式定义后,内联(非块状)元素可以定义宽度和高度a display:inlineb display:nonec display:blockd display:inherit2)css属性overflow属...

推荐范文