Blogger Information
Blog 175
fans 1
comment 0
visits 384938
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
完整的select语句
dxp2tq的博客
Original
1774 people have browsed it

一个完整的select语句格式如下

select 字段

from 表名

where …….

group by ……..

having …….(就是为了过滤分组后的数据而存在的—不可以单独的出现)

order by ……..

   

以上语句的执行顺序

1.         首先执行where语句过滤原始数据

2.         执行group by进行分组

3.         执行having对分组数据进行操作

4.         执行select选出数据

5.         执行order by排序

原则:能在where中过滤的数据,尽量在where中过滤,效率较高。having的过滤是专门对分组之后的数据进行过滤的。


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post