<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                為何查詢這么難? 業務的復雜性、對于效率的要求高。 1、查詢指定列 select field1,field2 as f2,field3 f3,... where ...; select * where ...; #* 為通配符,匹配所有的列。 2、對列進行運算 有時候存儲的信息并不是我們想要查詢的信息,比如存的是出生日期,我們需要查年齡,這時需要去對列進行計算。 select id,2016-age as "年齡" from table_name; ps: 對于常見的 +-*/ 都是支持的,不過對于 / 運算結果是浮點數。 當然列與列之間也可以運算。 3、統計信息 常用統計函數有 count、max、min、sum、avg 等等。比如: select 2016-max(age) as "最大年齡" from table_name; 4、內置函數 select now(); #查詢當前時間 5、去除重復數據 在 select 后字段前加 distinct,distinct 即“明確的,確切的”,比如: select id,distinct name from table_name; 6、where 子句 where 子句特點:如果后面表達式為 true,則進行相關處理,不管是查詢還是更新/刪除。 where 子句的常見形式如下: ① 比較運算符 < > = <= >= != 或 <> <=> 表示 null 安全的等于,即要不兩邊值相等,要不都為 null。 ② between...and 操作符 要用來選擇一個范圍的數據,比如 where id between 1 and 100。 ③ in 操作符 有時候條件是一些離散的值,并不是連續的區間,比如 where id in(1,3,5,7,9)。 ④ not 操作符 表示取反,一般不單獨使用,通常都與 in/between...and 一起使用; 使用位置在相應字段之后,其他運算符之前。 ⑤ is (not) null 是否為空 用來查找字段值為null的記錄,為什么不用 where xx = null 呢,因為該運算會返回 null,where 一直為假,也可以用 where xx <=> null 來查找。 ⑥ like 模式匹配 通常與 % 和 _ 一起使用,_ 代表一個字符,% 代表零個或多個字符,比如: where name like "%name_"; ⑦ regexp 正則匹配 regexp(regular expression),別名 rlike,通常用來執行更加復雜的字符串比較運算, ps: like 和 rlike 的區別是 like 要求運算符兩邊不是局部與全部的關系,而是一一對應。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看