SQLite中的表示式

大學霸發表於2018-05-10

SQLite中的表示式

SELECT的基本完整形式中,我們會看到幾乎是所有的子句都會使用到表示式。以下是SQLite支援的表示式型別。

expr binary-op expr |                                                                                                                //二元運算子

expr [NOT] like-op expr [ESCAPE expr] |                                                                    //LIKE運算子,匹配模式的一種

unary-op expr |                                                                                                                 //一元運算子

( expr ) |                                                                                                                             //括號

column-name |                                                                                                                          //列名

table-name . column-name |                                                                                        //表名.列名

database-name . table-name . column-name |                                                                  //資料庫名.表名.列名

literal-value |                                                                                                                     //字面量

parameter |                                                                                                                       //差數形式

function-name ( expr-list | * ) |                                                                                       //函式

expr ISNULL |                                                                                                                   //處理NULL

expr NOTNULL |                                                                                                              //非空

expr [NOT] BETWEEN expr AND expr |                                                                      //範圍

expr [NOT] IN ( value-list ) |                                                                                            //範圍

expr [NOT] IN ( select-statement ) |                                                                              //範圍

expr [NOT] IN [database-name .] table-name |                                                          //範圍

[EXISTS] ( select-statement ) |                                                                                       //存在

CASE [expr] ( WHEN expr THEN expr )+ [ELSE expr] END |                                  //條件結果

CAST ( expr AS type )                                                                                                     //轉換

本節將講解這些表示式中最為常用的幾種,如運算子、NULL的運算、引數形式、匹配模式、內建函式、條件結果等內容。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29597077/viewspace-2154266/,如需轉載,請註明出處,否則將追究法律責任。

相關文章