Sql 의 라 이브 러 리 분류 표 및 최적화

     Sql    

 sql           ,                  sql  ,         ,          。

             

    

    
                 
                  ,  :    

    
                      ,            ,
                       (Type),  (  ,  ,   )         

sql         

1.       ,         ,       where   order by2.       where          null    ,                    , :    
select id from t where num is null    
   num      0,    num   null ,      :    
select id from t where num=0

3.       where      != <>   ,                  。

4.       where       or      ,                    , :    
select id from t where num=10 or num=20select id from t where num=10    
union all    
select id from t where num=20

5.in   not in     ,         , :    
select id from t where num in(1,2,3)    
       ,   between      inselect id from t where num between 1 and 3

6.             :    
select id from t where name like '%abc%'

7.       where              ,                   。 :    
select id from t where num/2=100    
   :    
select id from t where num=100*2

8.      where            ,                   。 :    
select id from t where substring(name,1,3)='abc'--name abc   id    
   :    
select id from t where name like 'abc%'

9.    where=”      、            ,               。

10.            ,          ,                                 ,    
           ,                    。

11.            ,           :    
select col1,col2 into #t from t where 1=0    
             ,          ,     :    
create table #t(...)

12.      exists    inselect num from a where num in(select num from b)    
        :    
select num from a where exists(select 1 from b where num=a.num)

13.             ,SQL               ,            ,SQL           ,    
       sex,male、female     ,     sex                。

14.         ,            selectinsert   updateinsert   update          ,             ,       。    
             6 ,                          。

15.         ,                    ,            ,        。    
                             ,                  。

16.       varchar    char ,             ,        ,    
        ,                    。

17.          select * from t ,          “*”,            。

18.            ,           。

19.          ,                 ,  ,                      。  ,       ,       。

20.       ,            ,       select into    create tablelog ,    
     ;       ,          ,  create table,  insert。

21.         ,                     ,  truncate tabledrop table ,                。

22.        ,         ,           1  ,         。

23.                 ,                 ,           。

24.      ,         。         FAST_FORWARD                ,                     。
       “  ”                 。        ,                     ,           。
25.         ,        。26.              ,      ,            。

 

좋은 웹페이지 즐겨찾기