08-SQLite之in、between、alias,08-sqlitealias

來源:互聯網
上載者:User

08-SQLite之in、between、alias,08-sqlitealias
一、in操作符概述

IN 操作符允許我們在 WHERE 子句中規定多個值
文法:select column_name from table_name where column_name in (value1,value2,...);
例子1:從persons表中尋找name列中lucy和bob的資料資訊

二、between 操作符
操作符 between ... and 會選取介於兩個值之間的資料範圍。這些值可以是數值、文本或者日期
文法:select column_name from table_name where column_name between value1 and value2
例子1:從persons中選取name列中以字母順序介於"bob"和”com“之間的資料資訊

例子2:從pesons中選取id列中以數值順序介於2和3之外的資料資訊


三、alias操作符
可以為列名稱和表名稱指定別名
文法:select column_name as alias_name from table_name;
例子1:將persons表中的name取個別名alias_name


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.