搜档网
当前位置:搜档网 › Oracle中having、group by的用法

Oracle中having、group by的用法

Oracle中having、group by的用法
Oracle中having、group by的用法

Having

这个是用在聚合函数的用法。当我们在用聚合函数的时候,一般都要用到GROUP BY 先进行分组,然后再进行聚合函数的运算。运算完后就要用到HAVING 的用法了,就是进行判断了,例如说判断聚合函数的值是否大于某一个值等等。

select customer_name,sum(balance)

from balance

group by customer_name

having balance>200; yc_rpt_getnew

order by 、group by 、having的用法区别

order by 从英文里理解就是行的排序方式,默认的为升序。order by 后面必须列出排序的字段名,可以是多个字段名。

group by 从英文里理解就是分组。必须有“聚合函数”来配合才能使用,使用时至少需要一个分组标志字段。

什么是“聚合函数”?

像sum()、count()、avg()等都是“聚合函数”

使用group by 的目的就是要将数据分类汇总。

一般如:

select 单位名称,count(职工id),sum(职工工资) form [某表]

group by 单位名称

这样的运行结果就是以“单位名称”为分类标志统计各单位的职工人数和工资总额。

在sql命令格式使用的先后顺序上,group by 先于 order by。

select 命令的标准格式如下:

SELECT select_list

[ INTO new_table ]

FROM table_source

[ WHERE search_condition ]

[ GROUP BY group_by_expression ]

[ HAVING search_condition ]

1. GROUP BY 是分组查询, 一般 GROUP BY 是和聚合函数配合使用

group by 有一个原则,就是 select 后面的所有列中,没有使用聚合函数的列,必须出现在 group by 后面(重要)

例如,有如下数据库表:

A B

1abc

1bcd

1asdfg

如果有如下查询语句(该语句是错误的,原因见前面的原则)

select A,B from table group by A

该查询语句的意图是想得到如下结果(当然只是一相情愿)

A B

abc

1bcd

asdfg

右边3条如何变成一条,所以需要用到聚合函数,如下(下面是正确的写法): select A,count(B) as 数量 from table group by A

这样的结果就是

A 数量

1 3

2. Having

where 子句的作用是在对查询结果进行分组前,将不符合where条件的行去掉,即在分组之前过滤数据,条件中不能包含聚组函数,使用where条件显示特定的行。

having 子句的作用是筛选满足条件的组,即在分组之后过滤数据,条件中经常包含聚组函数,使用having 条件显示特定的组,也可以使用多个分组标准进行分组。

having 子句被限制子已经在SELECT语句中定义的列和聚合表达式上。通常,你需要通过在HAVING子句中重复聚合函数表达式来引用聚合值,就如你在SELECT语句中做的那样。例如:

SELECT A COUNT(B) FROM TABLE GROUP BY A HAVING COUNT(B)>2

Grouping 的用法:

指示是否聚合 group by 列表中的指定表达式。在结果集中,如果 Grouping 返回 1 ,表示聚合;如果 Grouping 返回 0 ,表示非聚合。如果指定了 Group by ,那么只能用在 Select , Having , Order by 中。

注释:

GROUPING 用于区分标准空值和由 ROLLUP 、 CUBE 或 GROUPING SETS 返回的空值。作为 ROLLUP 、 CUBE 或 GROUPING SETS 操作结果返回的 NULL 是 NULL 的特殊应用。它在结果集内作为列的占位符,表示全体。举例:

CREATE TABLE tt ( 产地 CHAR ( 8), 水果 CHAR ( 8), 重量 INT )

INSERT tt VALUES ( ' 北方 ' , ' 香蕉 ' , 3)

INSERT tt VALUES ( ' 北方 ' , ' 水蜜桃 ' , 2)

INSERT tt VALUES ( ' 南方 ' , ' 桔子 ' , 3)

INSERT tt VALUES ( ' 北方 ' , ' 水蜜桃 ' , 5)

INSERT tt VALUES ( ' 南方 ' , ' 香蕉 ' , 3)

INSERT tt VALUES ( ' 南方 ' , ' 水蜜桃 ' , 6)

INSERT tt VALUES ( ' 北方 ' , ' 桔子 ' , 8)

select

CASE WHEN ( GROUPING ( 产地 ) = 1) THEN ' 总计 ' ELSE ISNULL ( 产地 , 'UNKNOWN' )

END AS 产地 ,

CASE WHEN ( GROUPING ( 水果 ) = 1) THEN ' 小计 ' ELSE ISNULL ( 水果 , 'UNKNOWN' )

END AS 产地 ,

SUM ( 重量 ) 总重量

FROM TT

GROUP BY 产地 , 水果

WITH ROLLUP

结果:

/************************

北方 桔子 8

北方 水蜜桃 7

北方 香蕉 3

北方 小计 18

南方 桔子 3

南方 水蜜桃 6

南方 香蕉 3

南方 小计 12

总计 小计 30

*************************/

GROUPING(字段)=1的是对应字段汇总的

GROUPING(字段)=0的是对应字段原来的明细的信息

oracle Rollup 和 Cube用法

Oracle的GROUP BY语句除了最基本的语法外,还支持ROLLUP和CUBE 语句。如果是ROLLUP(A, B, C)的话,首先会对(A、B、C)进行GROUP BY,然后对(A、B)进行GROUP BY,然后是(A)进行GROUP BY,最后对全表进行GROUP BY操作。如果是GROUP BY CUBE(A, B, C),则首先会对(A、B、C)进行GROUP BY,然后依次是(A、B),(A、C),(A),(B、C),(B),(C),最后对全表进行GROUP BY操作。 grouping_id()可以美化效果:

Oracle的GROUP BY语句除了最基本的语法外,还支持ROLLUP和CUBE 语句。

除本文内容外,你还可参考:

分析函数参考手册: https://www.sodocs.net/doc/722160452.html,/post/419/33028

分析函数使用例子介绍:https://www.sodocs.net/doc/722160452.html,/post/419/44634

SQL> create table t as select * from dba_indexes; 表已创建。

SQL> select index_type, status, count(*) from t group by index_type, status;

INDEX_TYPE STATUS COUNT(*)

--------------------------- -------- ----------

LOB VALID 51

NORMAL N/A 25

NORMAL VALID 479

CLUSTER VALID 11

下面来看看ROLLUP和CUBE语句的执行结果。

SQL> select index_type, status, count(*) from t group by rollup(index_type, status);

INDEX_TYPE STATUS COUNT(*)

--------------------------- -------- ----------

LOB VALID 51

LOB 51

NORMAL N/A 25

NORMAL VALID 479

NORMAL 504

CLUSTER VALID 11

CLUSTER 11

566

已选择8行。

SQL> select index_type, status, count(*) from t group by cube(index_type, status);

INDEX_TYPE STATUS COUNT(*)

--------------------------- -------- ----------

566

N/A 25

VALID 541

LOB 51

LOB VALID 51

NORMAL 504

NORMAL N/A 25

NORMAL VALID 479

CLUSTER 11

CLUSTER VALID 11

已选择10行。

查询结果不是很一目了然,下面通过Oracle提供的函数GROUPING来整理一下查询结果。

SQL> select grouping(index_type) g_ind, grouping(status) g_st, index_type, status, count(*)

2 from t group by rollup(index_type, status) order by 1, 2;

G_IND G_ST INDEX_TYPE STATUS COUNT(*)

---------- ---------- --------------------------- -------- ----------

0 0 LOB VALID 51

0 0 NORMAL N/A 25

0 0 NORMAL VALID 479

0 0 CLUSTER VALID 11

0 1 LOB 51

0 1 NORMAL 504

0 1 CLUSTER 11

1 1 566

已选择8行。

这个查询结果就直观多了,和不带ROLLUP语句的GROUP BY相比,ROLLUP 增加了对INDEX_TYPE的GROUP BY统计和对所有记录的GROUP BY统计。 就是说,如果是ROLLUP(A, B, C)的话,首先会对(A、B、C)进行GROUP BY,然后对(A、B)进行GROUP BY,然后是(A)进行GROUP BY,最后对全表进行GROUP BY操作。

下面看看CUBE语句。

SQL> select grouping(index_type) g_ind, grouping(status) g_st, index_type, status, count(*)

2 from t group by cube(index_type, status) order by 1, 2;

G_IND G_ST INDEX_TYPE STATUS COUNT(*)

---------- ---------- --------------------------- -------- ----------

0 0 LOB VALID 51

0 0 NORMAL N/A 25

0 0 NORMAL VALID 479

0 0 CLUSTER VALID 11

0 1 LOB 51

0 1 NORMAL 504

0 1 CLUSTER 11

1 0 N/A 25

1 0 VALID 541

1 1 566

已选择10行。

和ROLLUP相比,CUBE又增加了对STATUS列的GROUP BY统计。

如果是GROUP BY CUBE(A, B, C),则首先会对(A、B、C)进行GROUP BY,然

后依次是(A、B),(A、C),(A),(B、C),(B),(C),最后对全表进行GROUP BY 操作。

除了使用GROUPING函数,还可以使用GROUPING_ID来标识GROUP BY结果。

SQL> select grouping_id(index_type, status) g_ind, index_type, status, count(*) 2 from t group by rollup(index_type, status) order by 1;

G_IND INDEX_TYPE STATUS COUNT(*)

---------- --------------------------- -------- ----------

0 LOB VALID 51

0 NORMAL N/A 25

0 NORMAL VALID 479

0 CLUSTER VALID 11

1 LOB 51

1 NORMAL 504

1 CLUSTER 11

3 566

已选择8行。

SQL> select grouping_id(index_type, status) g_ind, index_type, status, count(*) 2 from t group by cube(index_type, status) order by 1;

G_IND INDEX_TYPE STATUS COUNT(*)

---------- --------------------------- -------- ----------

0 LOB VALID 51

0 NORMAL N/A 25

0 NORMAL VALID 479

0 CLUSTER VALID 11

1 LOB 51

1 NORMAL 504

1 CLUSTER 11

2 N/A 25

2 VALID 541

3 566

已选择10行。

grouping_id()可以美化效果:

select DECODE(GROUPING_ID(C1), 1, '合计', C1) D1,

DECODE(GROUPING_ID(C1, C2), 1, '小计', C2) D2,

DECODE(GROUPING_ID(C1, C2, C1 + C2), 1, '小计', C1 + C2) D3,

count(*),

GROUPING_ID(C1, C2, C1 + C2, C1 + 1, C2 + 1),

GROUPING_ID(C1)

from T2

group by rollup(C1, C2, C1 + C2, C1 + 1, C2 + 1);

========================================= ==================

1.报表合计专用的Rollup函数

销售报表

广州 1月 2000元

广州 2月 2500元

广州 4500元

深圳 1月 1000元

深圳 2月 2000元

深圳 3000元

所有地区 7500元

以往的查询SQL:

Select area,month,sum(money) from SaleOrder group by area,month

然后广州,深圳的合计和所有地区合计都需要在程序里自行累计

1.其实可以使用如下SQL:

Select area,month,sum(total_sale) from SaleOrder group by rollup(area,month) 就能产生和报表一模一样的纪录

2.如果year不想累加,可以写成

Select year,month,area,sum(total_sale) from SaleOrder group by year,

rollup(month,area)

另外Oracle 9i还支持如下语法:

Select year,month,area,sum(total_sale) from SaleOrder group by

rollup((year,month),area)

3.如果使用Cube(area,month)而不是RollUp(area,month),除了获得每个地区的合计之外,还将获得每个月份的合计,在报表最后显示。

4.Grouping让合计列更好读

RollUp在显示广州合计时,月份列为NULL,但更好的做法应该是显示为"所有月份" Grouping就是用来判断当前Column是否是一个合计列,1为yes,然后用Decode把它转为"所有月份"

Select Decode(Grouping(area),1,'所有地区',area) area,

Decode(Grouping(month),1,'所有月份',month), sum(money) From SaleOrder Group by RollUp(area,month);

2.对多级层次查询的start with.....connect by

比如人员组织,产品类别,Oracle提供了很经典的方法

SELECT LEVEL, name, emp_id,manager_emp_id FROM employee START WITH manager_emp_id is null CONNECT BY PRIOR emp_id = manager_emp_id;

上面的语句demo了全部的应用,start with指明从哪里开始遍历树,如果从根开始,那么它的manager应该是Null,如果从某个职员开始,可以写成emp_id='11' CONNECT BY 就是指明父子关系,注意PRIOR位置

另外还有一个LEVEL列,显示节点的层次

3.更多报表/分析决策功能

3.1 分析功能的基本结构

分析功能() over( partion子句,order by子句,窗口子句)

概念上很难讲清楚,还是用例子说话比较好.

3.2 Row_Number 和 Rank, DENSE_Rank

用于选出Top 3 sales这样的报表

当两个业务员可能有相同业绩时,就要使用Rank和Dense_Rank

金额 RowNum Rank Dense_Rank

张三 4000元 1 1 1

李四 3000元 2 2 2

钱五 2000元 3 3 3

孙六 2000元 4 3 3

丁七 1000元 5 5 4

这时,应该把并列第三的钱五和孙六都选进去,所以用Ranking功能比RowNumber保险.至于Desnse还是Ranking就看具体情况了。

SELECT salesperson_id, SUM(tot_sales) sp_sales, RANK( ) OVER (ORDER BY SUM(tot_sales) DESC) sales_rank FROM orders GROUP BY salesperson_id

3.3 NTILE 把纪录平分成甲乙丙丁四等

比如我想取得前25%的纪录,或者把25%的纪录当作同一个level平等对待,把另25%当作另一个Level平等对待

SELECT cust_nbr, SUM(tot_sales) cust_sales, NTILE(4) OVER (ORDER BY

SUM(tot_sales) DESC) sales_quartile FROM orders GROUP BY cust_nbr ORDER BY 3,2 DESC;

NTITLE(4)把纪录以 SUM(tot_sales)排序分成4份.

3.4 辅助分析列和Windows Function

报表除了基本事实数据外,总希望旁边多些全年总销量,到目前为止的累计销量,前后三个月的平均销量这样的列来参考.

这种前后三个月的平均和到目前为止的累计销量就叫windows function, 见下

SELECT month, SUM(tot_sales) monthly_sales, SUM(SUM(tot_sales)) OVER (ORDER BY month ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) max_preceeding FROM orders GROUP BY month ORDER BY month;

SELECT month, SUM(tot_sales) monthly_sales, AVG(SUM(tot_sales)) OVER (ORDER BY month ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) rolling_avg FROM orders GROUP BY month ORDER BY month;

Windows Function的关键就是Windows子句的几个取值

1 PRECEDING 之前的一条记录

1 FOLLOWING 之后的一条记录

UNBOUNDED PRECEDING 之前的所有记录

CURRENT ROW 当前纪录

4.SubQuery总结

SubQuery天天用了,理论上总结一下.SubQuery 分三种

1.Noncorrelated 子查询 最普通的样式.

2.Correlated Subqueries 把父查询的列拉到子查询里面去,头一回cyt教我的时候理解了半天.

3.Inline View 也被当成最普通的样式用了.

然后Noncorrelated 子查询又有三种情况

1.返回一行一列 where price < (select max(price) from goods )

2.返回多行一列 where price>= ALL (select price from goods where type=2)

or where NOT price< ANY(select price from goods where type=2)

最常用的IN其实就是=ANY()

3.返回多行多列 一次返回多列当然就节省了查询时间

UPDATE monthly_orders SET (tot_orders, max_order_amt) = (SELECT COUNT(*), MAX(sale_price) FROM cust_order) DELETE FROM line_item WHERE (order_nbr, part_nbr) IN (SELECT order_nbr, part_nbr FROM

cust_order c)

======================================== /*--------理解grouping sets

select a, b, c, sum( d ) from t

group by grouping sets ( a, b, c )

等效于

select * from (

select a, null, null, sum( d ) from t group by a

union all

select null, b, null, sum( d ) from t group by b

union all

select null, null, c, sum( d ) from t group by c

)

*/

中考英语口语辅导:consider的用法

中考英语口语辅导:consider的用法 表示“考虑”,其后可接动名词,但不能接不定式。如He is considering changing his job. 他在考虑调换工作。I’ve never really considered getting married. 我从未考虑过结婚的事。注:consider 之后虽然不能直接跟不定式,但可跟“疑问词+不定式”结构。如Have you considered how to get there / how you could get there. 你是否考虑过何到那儿去?2. 表示“认为”、“把……看作”,下面三个句型值得注意(有时三者可互换) (1) consider +that从句(2) consider+宾语+(as +)名词或形容词(3) consider+宾语+(to be +)名词或形容词I consider him (as) honest (或an honest man). I consider him (to be) honest (或an honest man). I consider that he is honest (或an honest man). 注:(1) 以上备句意思大致相同,对于consider 之后能否接as 的问题,尚有不同看法(即有人认为不能接as ,有人认为可以拉as,但实际上接as 的用法已很普遍)。(2) 在“consider+宾语”之后除可接to be 外,有时也可to do 型动词(但多为完成形式)。如We all considered him to have acted disgracefully. 我们都认为他的行为很不光彩。

动名词的用法

动名词的用法及练习 你听过英文语法有动词(verb)、名词(noun);但你听过有动名词(gerund)吗 1. The girl is singing a song. 2. The girl singing now is my sister. 3. Singing is one of her hobbies(爱好). 一、名词性的动名词(Nominal Gerund) Nominal Gerund 可以加上定冠词(Definite article,如the)或不定冠词(Indefinite article,如a, an),其他可加在动名词前的还有如:my, this, some, any, all, no 等等。举例如下: 1. The mellow(愉快地) singing of the birds announces the coming of spring. (singing前加定冠词the及形容词mellow;coming 前加the) 2. We knew the robber was near when we heard a faint rustling(沙沙声) in the bushes. (rustling 前加不定冠词a及形容词faint) 从上面的例子可看出如何将一个动词转成名词;但它和真正的名词还是有区别的,那就是没有单数或复数之分。不过,有一些动名词是可以变成真正名词的喔,如:saying, writing, opening, painting, cutting, heading, feeling, being,saving, surrounding, crossing, misunderstanding 等等。它们都可以有复数的喔,方法就是在它们的后面加个s,如:paintings。 二、动词性的动名词(Verbal Gerund) 看看下面的句子: Carelessly writing essays annoys the teacher. 上面的句子里的writing是动名词,但前面有副词carelessly(粗心地),后面又有受词(Object) essays。因此writing就有动词的特征。 注意:Verbal Gerund 这类动名词的前面可不能加上任何冠词(the, a, an ...)喔。 动名词的功能与用法 一、在句子中用作主语(Subject)或主语的补语(Subject Complement): 作主语 1. Listening to music gives me pleasure. (主语Listening ) 2. Running is good exercise. (主语running) 3. Walking to school is a good idea. (主语walking) 作主语的补语 1. My cat's favorite activity is sleeping. (补语sleeping) 2. Seeing is believing. (主语seeing, 补语believing) 主语置于句尾用It + be + ... +v-ing 句型 1. It is fun speaking English. 2. It is of great importance fighting against pollution(污染). 用It is 后接no use. no good, fun 等的句型 1. It is no use learning theory without practice. 2. It is no fun being lost in rain. 用It is 后接useless, nice, good, interesting, worthwhile 等的句型 1. It is worthwhile taking this into consideration. 用There + be + no + v-ing 的句型 1. There is no joking about such matters. 2. There is no getting along with him. (简直无法与他相处) 二、动名词也可以作宾语(Object) 作动词/动词短语的宾语(置于动词或动词短语的后面) 1. I cannot help laughing. (我禁不住笑了起来)(宾语laughing) 2. You should avoid quarrelling with your sister. (宾语quarrelling) 3. You should practice speaking English more. (宾语speaking) 注意:上面三个句子中的动词:help, avoid, practice 只能用动名词作宾语。这类动词还有:dislike 厌恶admit 接受repent 后悔acknowledge 承认

(完整版)英语代词的用法全归纳

英语词类 英语中的词可以根据词义、语法功能和形式特征分为十大类,即名词(noun)、代词(pronoun)、形容词(adjective)、副词(adverb)、动词(verb)、数词(numeral)、冠词(article)、介词(preposition)、连词(conjunctions)和感叹词(int erjection)。 英语代词的用法全归纳 一、定义与分类 代词是代替名词及起名词作用的短语或句子的词。代词根据其意思和用法可分为人称代词、物主代词、反身代词、指示代词、相互代词、疑问代词、连接代词、关系代词、不定代词九类。综观历年高考情况,在这九类代词中,不定代词一直是高考英语的重点。 二:人称代词,物主代词,反身代词用法概述 这三种代词都有人称(第一、二、三人称)的变化、数(单、复数)的变化,性(阴性、阳性、中性)以及格(主格、宾格)的变化。 物主代词又包括两种形式:形容词性物主代词和名词性物主代词。特别注意:形容词性物主代词its没有相应的名词性物主代词。 这三种代词的形式变化表如下:

三、人称代词的用法 1) 定义:人称代词是用来指代人、动物或事物的代词。它必须在人称(第一人称、第二人称、及第三人称)、数(单数、复数)以及性(阴性、阳性、中性)三方面与被指代的名词一致。 如:I am a student. Tom is a boy, and he is a student. Mary is very pretty, and she likes singing. The boys are students, and they are in the room. The doy is small. It is Tom's. 2)人称代词的句法功能 A) 人称代词有主格和宾语之分:主格用作主语,宾格用作宾语。 B) 人称代词的主格形式在在句中作主语和表语。 如: I like music(主语). She is a teacher.(主语)

consider的基本用法及与regardthinkofabout

consider的基本用法及与regard,think ofabout和look(up)on as的区别 consider的基本用法及与regard,think of/about和look(up)on as的区别 consider一词在历年高考中是一个常考的要点,其用法应分为两部分来讲。第一、作“考虑、思考”时的搭配如下: 1.consider+n./pron.,例如: Have you considered the suggestion? That’s what we have to consider now. 2.consider+v-ing,但不能接不定式的一般式,例如: We considered going to see the doctor the next day. Have you considered moving to shanghai recently? You must consider to tell him something about it.(错误) 3.consider+疑问词+不定式,例如: He is considering how to improve his English. We must consider what to do next.

4.consider+从句,例如: We didn’t consider whether he should go or not. Have you considered when we should go there? 第二、作“认为、把……当作/看作”等意思时的搭配如下:1.consider+sb/sth+(to be/as)+n./adj.,例如: I consider him to(be/as)my best friend. Everyone considers him(to be)clever. He considered it much improved. 2.consider+sb./sth.+不定式短语(作宾语补足语),不能接不定式的一般式,例如: We consider them to be working very hard. We consider them to have finished the work. We consider him to be the clever in our class. We must consider him to go there at once.(错误) 3.consider+it+adj./n.+不定式短语,其中it为形式宾语,不定式短语为真正的宾语,例如: Jiao Yulu considered it his duty to serve the people heart and soul. They consider it necessary to set the slaves free.

twist的用法总结大全

twist的用法总结大全 twist的用法你知道多少,今天给大家带来twist的用法,希望能够帮助到大家,下面就和大家分享,来欣赏一下吧。 twist的用法总结大全 twist的意思 vt. 扭成一束,搓,捻,绕,卷,连结,交结 vi. 被搓揉,蜿蜒,曲折,扭曲身体,扭动,旋转,转动 n. 揉搓之物,丝线,烟草卷,旋转 变形:过去式: twisted; 现在分词:twisting; 过去分词:twisted; twist用法 twist可以用作动词 twist的基本意思是指纺纱或捻线的一个程序,两股或多股细丝互相拧成纱或线。引申可指“盘绕”“旋转”“扭伤”。用于比喻可指“曲解(话、词等的)意义”。

twist可用作不及物动词,也可用作及物动词。用作及物动词时,接名词或代词作宾语。可用于被动结构。用作不及物动词时,主动形式可含有被动意义。 twist有时可接以形容词作补足语的复合宾语。 twist用作动词的用法例句 She twisted the long scarf round her head.她把那条长围巾围在头上。 Selecting the suitable twist factor in order to meet the needs of flax knitting yarn, it is the key to increase high_grade and productivity of flax knitting products.选择合理的捻系数以满足针织用纱的要求是提高亚麻针织产品档次和生产效率的关键。 We twisted the bed sheets into a rope and escaped by climbing down it.我们把床单搓成绳子,援绳下坠逃跑了。 twist用法例句 1、The battle of the sexes also took a new twist. 两性之争也出现了新的变数。 2、Twist the string carefully around the second stem with the other hand.

不定代词用法总结

不定代词总结 一、不定代词 some 与 any 的用法区别 一般说来,不定代词 some 用于肯定句中, any 用于否定句和疑问句中。但是,在表示请求、邀请或征求意见的句子中,通常要用 some 而不用 any : Would you like some cake? 吃点蛋糕吗? Why not buy some bread? 为什么不买些面包呢? Shall I get some chalk for you? 要我帮你拿些粉笔来吗? 【说明】不定代词 any 有时也用于肯定句中,此时表示“任何”: Any colour will do. 任何颜色都行。 Come any day you like. 随便哪天来都可以。 二、不定代词 many 与 much 的用法以及区别 不定代词 many 和 much 都表示“许多”,但 many 修饰或代替可数名词(复数),与 few(少数)相对;而 much 用来修饰或代替不可数名词(单数),与 little(少量)相对。在口语中两者主要用于非肯定句中: Did you see many people there? 你在那儿看见许多人了吗 ? We don 't have much time. 我们没有许多时间。 Much work has been done. 许多工作都已经做了。 You 've given me too much. 你已给我太多了。 Take as many (much) as you want. 你要多少拿多少。 I asked her a great many questions. 我问了她许多问题。 辨析: too much ; much too ; too many 1、too much 常用作副词或代词 ,也可以用作形容词修饰不可数名词 .如: Is watching TV too much good or bad for your health? 电视看得太多对你的健康有益还是有害 ? You've given me too much. 你给我的太多了 .

Consider的用法

Consider的用法: -Have you considered_____ the job ss a teacher? -Yes.I like it because a teacher is often considered _______ a gardener. A.to take,to be B.to take,being C.taking,being D.taking,to be 答案:d译文:你考虑过做老师的工作吗? 是的,我非常喜欢,因为老师通常被认为是园丁 一、consider作“考虑”解,常用于以下句型: 1.consider+名词/代词/动名词。 You'd better consider my suggestion. 你最好考虑我的建议。 I’m considering going abroad some day.我一直考虑有一天出国。 2.consider+从句或“疑问词+不定式”。 Have you considered what he suggested? 你们考虑他的建议了吗? We must consider what to do next. 我们必须考虑下一步要做什么。 二.consider作“认为”解时,常用于以下句型: 1.consider sb./sth+.(as)+形容词/名词。其中,as可以省略。 We consider him honest. 我们认为他很诚实。 At first they considered me as a doctor.起初他们认为我是医生。 2.consider+sb./sth.+不定式。其中,不定式通常是to be(可以省略)或其他动词的完成式。We consider this matter to be very important. 我们认为这件事很重要。 We all consider him to have stolen the bike.我们都认为他偷了自行车。 3.consider+it+形容词/名词+不定式短语。 We consider it hard to study English well.我们认为学好英语很难。 I consider it my duty to help you with your studies.我认为帮助你学习英语是我的职责。 4.consider+宾语从句。 We consider that the music is well worth listening to.我们这首音乐很值得一听。 在该题中,前一个句子中的consider作“考虑”解,后接动名词作宾语,但不可接不定式,由此可以排除A, B; 后一个句子中的consider作“认为”解,用到句型consider+sb./sth.+不定式,此处使用的是被动语态结构。故答案为D项。 请看下面两道考题,均考查“with+宾语+非谓语动词”结构: 1.—Come on, please give me some ideas about the project. —Sorry. With so much work _________my mind, I almost break down. A.filled B.filling C.to fill D.being filled 2.John received an invitation to dinner, and with his work _________, he gladly acc epted it. A.finished B.finishing C.having finished D.was finished 以上两题答案分别为B和A,均考查“with+宾语+非谓语动词”结构。该结果中的“非谓语动词”可以是不定式、现在分词、过去分词,它们在用法上的区别如下:

动名词的用法详解

动名词的用法详解 今天给大家带来动名词的用法详解,我们一起来学习吧,下面就和大家分享,来欣赏一下吧。 英语语法:动名词的用法详解 动名词因同时拥有动词和名词两者的特点而拥有及其丰富 的用法,熟练的掌握这些用法不仅可以使口语表达更地道生动,也能在写作中增分添彩。 动名词主要有四种用法,做主语,作宾语,作表语,作定语,每种用法下又分小类别,是一个非常复杂庞大的系统,学习者们往往会理不清脉络,今天就为大家带来动名词的用法讲解。 一.作主语 1.直接位于句首 eg.Swimming is a good sport in summer. 2.用it作形式主语,把动名词(真实主语)置于句尾作后置主语。 eg.It is no use telling him not to worry.

.mportant,essential,necessary等形容词不能用于上述结构。 3.用于“There be”结构中 eg.There is no saying when hell come. 4.动名词的复合结构作主语: 当动名词有自己的逻辑主语时,常可以在前面加上一个名词或代词的所有格,构成动名词的复合结构,动名词疑问句通常使用这种结构做主语 eg.Their coming to help was a great encouragement to us. Does your saying that mean anything to him? 二.作宾语 1.作动词的宾语 某些动词后出现非限定性动词时只能用动名词作宾语,不能用不定式。不定式通常指某种特定的动作,但动名词表示泛指,常见的此类动词有: admit,appreciate,excuse,stand,advise,allow,permit,avoid,consider,e njoy,finish,give up,cannot help,imagine,include,keep,understand,keepon,mind,report,risk,mis s,put off,delay,practise,resist,suggest,depend on,think about,set about,succeed in,worry about,burst out,insist on,feel like,be used

英语代词用法总结(完整)

英语代词用法总结(完整) 一、单项选择代词 1.I’m as big as human. In fact, I look like ______ too. A.the one B.that C.it D.one 【答案】D 【解析】 考查不定代词。句意:我同人一样大,事实上,我看起来像一个人。此处用one代替前面的human,故选D。 2.The Olympic Games makes _____ possible for people to live side by side in peace. A.this B.it C.that D.不填 【答案】B 【解析】 本题的含义是奥运会使人们能够和平的生活在一起成为可能,本题make后的真正宾语位于句尾用动词不定式,那么在英文中通常用形式宾语it来代替真正的主语,故本题选B。 3.----Will $ 1,000 _______ the cost of the trip? ----I’m afraid not. Perhaps I need _______ $500. A.pay; another B.charge; more C.cover; another D.afford; more 【答案】C 【解析】 句意“1000美元够旅行的费用吗?”“恐怕不够,也许还需要500美元。”charge“收费”;cover“包括”;afford“买得起”。根据句意可知,用cover;在原来的基础上再多一些用“another+数词”或“数词+more”表示,这里用another。故选C。 4.--- Daddy, do you like ________ if I buy a purse for my mom’s birthday? --- It couldn’t be better. A.this B.one C.that D.it 【答案】D 【解析】 在此句中,it是一个形式宾语。根据句意,可知选D。 句意:--爸爸,我买给妈妈一个钱包作为生日礼物你喜欢吗?--那最好不过了。 考点:代词/不定代词 5.Jack Ma, the founder and chairman of China’s Alibaba Group, has a $28.6 billion fortune, ______making him the richest person in China. A.it B.one C.that D.which 【答案】B

consider的用法归纳有哪些

consider的用法归纳有哪些 consider的用法:作名词 consideration作名词,意为careful thought and attention斟酌,考虑 Several considerations have influenced my decision.好几个因素影响了我的决定。 1.Consideration for顾及,体贴 He has never shown much consideration for his wife’s needs.他从来不顾及他妻 子的需要。 2.Under consideration在讨论/考虑中 Several projects are under consideration.好几个项目在讨论中。 There are some proposals under consideration. 有几个建议在审议中。 3.Take sth. into consideration考虑到某事,体谅 Your teachers will take your recent illness into consideration when marking your exams. 你的几位老师在给你的考试评分时,会考虑你最近生病这一情况的。 4.Leave sth. out of consideration 忽略/不重视某事 It was wrong to leave my feelings out of consideration.不顾及我的情感是不对的。 5.Show consideration for体谅,顾及 Jeff never shows any consideration for his mother’s feelings.杰夫从来不体谅他 母亲的感受。 6.of. No / little consideration无关紧要的,不重要的 Whether he would go with us or not was of no consideration. 他是否跟我们一起 去是无关紧要的。 7.In consideration of sth.作为对……的汇报,考虑到 It’s a small payment in consideration of your services.这是答谢您服务的微薄酬金。 consider的用法:作动词 1.Consider作动词,意为think about sth.考虑,斟酌 常用搭配:consider sth. / doing sth. / where(how, why)+to do /that clause; all things considered通盘考虑,考虑到问题的各个方面。如:

allow,permit,advise,forbid 后接动词

doing allow,permit,advise,forbid sb to do 有这样几道题: a. We don’t allow __________ in the office. b. We don’t allow people __________ in the office. c. People are not allowed __________ in the office. A. smoking B. to smoke C. smoked D. smoke 此题答案为a句选 A,b句和c句均选 B。一般说来,动词allow(允许)之后应接动名词作宾语,但是若其后接有名词或代词作宾语,则其宾语后的补足语应用不定式,而不是动名词(注意:c句与b句同义,只是c句为b句的被动形式)。 类似以上用法的动词还有 permit,advise,forbid等: 1. a. We don’t permit _________ on the grass. b. We don’t perm it people _________ on the grass. c. People are not permitted _________ on the grass. A. walk B. to walk C. walking D. walked 2. a. He advised _________ early. b. He advised us _________ early. c. We were advised _________ early. A. leave B. to leave C. leaving D. left 3. a. We forbid __________ a noise. b. We forbid people __________ a noise. c. People are forbidden __________ a noise. A. make B. to make C. making D. made

疑问代词用法总结及练习

疑问代词用法总结及练习 句子是英语学习的核心。从句子使用的目的来分,它可分为四类 1、陈述句(肯定句和否定句) 2、疑问句(一般疑问句、特殊疑问句和选择疑问句) 3、祈使句(肯定句和否定句) 4、感叹句。 四大句子类型的相互转换,对于学生来讲是个难点,为此,可通过说顺口溜的形式来帮助学生解决这一难题。 如:将陈述句变成一般疑问句,可以变成这样的顺口留:疑问疑问调个头,把be(系动词“is are am”)放在最前头。 如:将陈述句的肯定句变成否定句,我们就可以这样说:否定,否定加“not”,加在何处,加在系动词的后面。 在句子相互转换的题型中,最难的要算“就下列划线部分提问”或是“看答句,写问句”这种题型了,其实,我们只要熟练掌握疑问词(what,what time, what colour, where, when, who, whose, which, how, how old ,how tall, how long, how big, how heavy , how much, how many等等)具体用法。

习题 一、选择正确的单词填空 (who, where, when) is that pretty girl She is my sister. are Jack and Tom They are behind you. do you go to school I go to school from Monday to Friday. has a beautiful flower John has a beautiful flower.

are they They are my parents. is my mother She is in the living room. are you going We are going to the bakery(面包坊). Jim and Wendy play ball They play ball in the afternoon. does he jog He jogs in the park. are you from I'm from Changchun city. 11. _______ is your birthday –On May 2nd. 12、_______ are you --- I`m in the office. 13. are you ---- I`m Alice. 二.用(what time, what color, what day, what)填空。 1. A: ______ _______ is it B: It is nine o’clock. 2. A: ______ _______ does your mother get up B: My mother gets up at 6:30. 3. A: ______ _______ do you go to bed B: I go to bed at 10:00. 4. A: ______ _______ do Diana and Fiona have supper B: Diana and Fiona have supper at 18:00. 5. A: ______ _______is it B: It is purple. 6. A: ______ _______ is the sky B: The sky is blue. 7. A: ______ _______ is your coat B: My coat is black. 8. A: ______ _______ is the dog B: The dog is white. 9. A: ______ _______ is today B: Today is Monday. 10. A: ______ _______ is tomorrow B: Tomorrow is Tuesday. 11. A: ______ _______ was yesterday B: Yesterday was Sunday. 12. A: ______ _______ do you like B: I like red. 13. A: ______ is this This is a computer. 14. A: ______ are you doing B: We are playing basketball.

高考重点英语语法之allow与permit的运用

高考重点英语语法之allow与permit的运 用 he rules of the club do not permit smoking. 这个俱乐部规定不准吸烟。 They shouldn’t allow parking here; the street is too narrow. 这儿不该允许停车,马路太窄了。 我们不许在池子里游泳。 正:We don’t allow swimming in the pool. 误:We don’t allow to swim i n the pool. 但是,它们虽然不能直接跟不定式作宾语,但可跟不定式的复合结构作宾语。如: We don’t allow [permit] students to eat in the classrooms. 我们不允许学生在教室吃饭。 两者均可后接双宾语。如: We allow passengers one item of hand luggage each. 我们允许每个乘客带一件手提行李。 As it was such a special occasion, she permitted herself a small glass of champagne. 由于那是一个很特别的场合,所以她。

两者均不能后接that引导的宾语从句。如: 我们不允许人们在大教室抽烟。 误:We don’t all [permit] that people smoke in the lecture room. 正:We don’t allow [permit] people to smoke in the lecture room. allow与allow的几点区别: (1) permit 通常指上级、规则或法令等表示的准许,其语气较重;而allow 通常指消极地不加反对,有时含有听任或默许之意,语气较轻:The nurse allowed him to remain there,though it was not permitted. 护士让他留在那儿,而按规定那是不许可的。 (2) permit可用于带形式主语it的被动结构,但allow不行。如: It is not permitted to smoke in the kitchen. 厨房内不准吸烟。

疑问代词用法总结归纳

疑问代词用法总结归纳 以下是为大家整理的疑问代词的用法总结,希望能帮助大家更好地认识疑问代词,提高英语水平。 1) 疑问代词在句中起名词词组的作用,用来构成疑问句。疑问代词有下列几个: 指人:who, whom, whose 指物:what 既可指人又可指物:which 2) 疑问代词在句中应位于谓语动词之前,没有性和数的变化,除who之外也没有格的变化。what, which, whose还可作限定词。试比较: 疑问代词:Whose are these books on the desk? 桌上的书是谁的? What was the directional flow of U. S. territorial expansion? 美国的领土扩张是朝哪个方向的? 限定词:Whose books are these on the desk? 桌上的书是谁的? What events led to most of the east of the Mississippi River becoming part of the United States?哪些事件使密西西比

河以东的大部分土地归属于美国? 说明1: 无论是做疑问代词还是限定词,which 和what 所指的范围不同。what所指的范围是无限的,而which则指在一定的范围内,例如: What girls do you like best? 你喜欢什么样的姑娘? Which girls do you like best? 你喜欢哪几个姑娘? 说明2: Whom是who的宾格,在书面语中,它作动词宾语或介词宾语,在口语中作宾语时,可用who代替,但在介词后只能用whom, 例如: Who(m) are you taking the book to? 你要把这书带给谁?(作介词宾语,置句首) Who(m) did you meet on the street? 你在街上遇到了谁?(作动词宾语) To whom did you speak on the campus? 你在校园里和谁讲话了?(作介词宾语,置介词后,不能用who 取代。) 说明3: 疑问代词还可引导名词性从句,例如:

2014年高考高中英语知识点详解及训练(7):allow、permit的用法

高中英语知识点大全(7):allow/permit的用法 1、allow/permit 1)用法相同 allow / permit sb .to do sth .允许某人做某事 allow / permit doing sth . 允许做某事。此时动词只用ing 形式。 反义词forbid 具有同样用法。 2)意义有异同 许多情况下可换用,只是词意的强弱上有差异。allow语意较弱,含有“听任”,“默许”,“不加阻止”的意思;permit 语意较强,强调“正式认可”,“批准”的意思。如: The nurse allowed him to remain there ,though it was not permitted.护士让他留在那里,虽然这时(规定)不允许的。 2、amaze amaze vt.使……惊奇= astonish, surprise The news amazed us greatly.这条消息使我们感到很惊奇。 拓展:(1)amazed人对……感到吃惊的;amazing(某物)……信人吃惊的。 They were all amazed at the amazing news. 听到这个令人吃惊的消息他们感到惊讶。 (2)amazement n. to one’s amazement令人吃惊的是 To my amazement, they have gone to Xishuangbanna. 让我奇怪的是,他们去西双版纳了。

类似短语:to one’s happiness/excitement/sadness/puzzlement 使某人高兴的/兴奋的/伤心的/迷惑的是 3、announce/ explain/ introduce/ declare announce, explain, introduce, declare后面不接双宾语,若以人作宾语常置于to后。如: The president announced to the workers the sad news. The president announced the sad news to the workers.总裁向工人宣布了那不幸的消息。 He introduced the new comer to everyone here.他把新来的那个人介绍给这里的每个人。 report to sb.向某人汇报 report sth/sb.to sb.向某人汇报/告诉。 [应用]单句改错 ①The teacher explained his students how to use the computer. ②No one declared us we could not smoke here. Key:①explain后加to ②declare后加to

【英语】英语代词用法总结(完整)

【英语】英语代词用法总结(完整) 一、单项选择代词 1.-Which of these two ties will you take? -I don't like these. Do you have any_____? A.one B.other C.ones D.others 【答案】D 【解析】 考查对不定代词的用法。--两个领带你想要哪一个?--都不喜欢,还有其他的吗? others=other+名词”,泛指“别的人或物,其他的人/物”,故选D。 【名师点睛】不定代词one,ones , other 和others的区别。 不定代词即不指明代替任何特定名词或形容词的代词。 1.不定代词one指代可数名词,既可指人,亦可指物,它可以代替上文中出现的单数可数名词,指代复数名词时可以用ones。 例如:I do not have a pen, can you lend me one? I like small cars better than large ones. 2.other具有名词和形容词性质,既可指人,亦可指物。other常与定冠词the连用。other只作形容词或代词,表示“其他的,别的”,不可单独使用。 例如:Do you have any other questions? the other作形容词或代词,特指两者中或两部分的另一个或另一部分。 3.others相当于“other+名词”,泛指“别的人或物”,只有名词性用法。 例如:Some are planting trees, others are watering them. 2.You should make ______ a rule to leave things______ you can find them easily. A.it; where B.it; then C.that; there D.this; when 【答案】A 【解析】 考查代词及状语从句。句中it作形式宾语,真正宾语为to leave things where you can find them easily;where引导地点状语从句,选A。 3.-Which of the ways should I take to the village? - way as you please.All seem to be equal in distance. A.Neither B.None C.Any D.Either 【答案】C 【解析】 考查代词:A.Neither两者都不,B.None三者以上都不,C.Any三者任何一个,D.Either两者任何一个,从后面的all看出路是三条以上,句意是:--你想走哪条路去村子?-你喜欢走哪条就走哪条,距离上都是一样的。选C。

相关主题