您的位置:首页 > 数据库

SQL函数(-)

2015-09-10 16:32 309 查看
附录 any some
all 区别

> ANY(sub-qurey)  ---  >
MIN(sub-qurey)

< ANY(sub-query)  ---  <
MAX(sub-qurey)

> ALL(sub-query)  ---  >
MAX(sub-qurey)

< ALL(sub-query)  ---  <
MIN(sub-qurey)

=ANY  相当于in

=any(2,4) =in(2,4)

all 是查询还可以是子查询

如:

select name from edit 其中name前省略了all.

name前可以加ALL|DISTINCT  
all是所有记录.   distinct是不重复的。

eg:

SQL> select * from customers

CUSTOMER_ID FIRST_NAME LAST_NAME 
DOB           
PHONE                        
 

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

         
1
John      
Brown     
01-1月
-65    
800-555-1211                 
 

         
2 Cynthia   
Green     
05-2月
-68    
800-555-1212                 
 

         
3
Steve     
White     
16-3月
-71    
800-555-1213                 
 

         
4
Gail      
Black                    
800-555-1214                 
 

        
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: