<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ### sequelize 查詢示例 ~~~ const Op = Sequelize.Op [Op.and]: {a: 5} // 且 (a = 5) [Op.or]: [{a: 5}, {a: 6}] // (a = 5 或 a = 6) [Op.gt]: 6, // id > 6 [Op.gte]: 6, // id >= 6 [Op.lt]: 10, // id < 10 [Op.lte]: 10, // id <= 10 [Op.ne]: 20, // id != 20 [Op.eq]: 3, // = 3 [Op.not]: true, // 不是 TRUE [Op.between]: [6, 10], // 在 6 和 10 之間 [Op.notBetween]: [11, 15], // 不在 11 和 15 之間 [Op.in]: [1, 2], // 在 [1, 2] 之中 [Op.notIn]: [1, 2], // 不在 [1, 2] 之中 [Op.like]: '%hat', // 包含 '%hat' [Op.notLike]: '%hat' // 不包含 '%hat' [Op.iLike]: '%hat' // 包含 '%hat' (不區分大小寫) (僅限 PG) [Op.notILike]: '%hat' // 不包含 '%hat' (僅限 PG) [Op.startsWith]: 'hat' // 類似 'hat%' [Op.endsWith]: 'hat' // 類似 '%hat' [Op.substring]: 'hat' // 類似 '%hat%' [Op.regexp]: '^[h|a|t]' // 匹配正則表達式/~ '^[h|a|t]' (僅限 MySQL/PG) [Op.notRegexp]: '^[h|a|t]' // 不匹配正則表達式/!~ '^[h|a|t]' (僅限 MySQL/PG) [Op.iRegexp]: '^[h|a|t]' // ~* '^[h|a|t]' (僅限 PG) [Op.notIRegexp]: '^[h|a|t]' // !~* '^[h|a|t]' (僅限 PG) [Op.like]: { [Op.any]: ['cat', 'hat']} // 包含任何數組['cat', 'hat'] - 同樣適用于 iLike 和 notLike [Op.overlap]: [1, 2] // && [1, 2] (PG數組重疊運算符) [Op.contains]: [1, 2] // @> [1, 2] (PG數組包含運算符) [Op.contained]: [1, 2] // <@ [1, 2] (PG數組包含于運算符) [Op.any]: [2,3] // 任何數組[2, 3]::INTEGER (僅限PG) [Op.col]: 'user.organization_id' // = 'user'.'organization_id', 使用數據庫語言特定的列標識符, 本例使用 PG ~~~ 數據表結構 | id | name | age | sex | address | math | english | | --- | --- | --- | --- | --- | --- | --- | | 張三 | 23 | 男 | 18 | 云南 | 60 | 40| | 李四 | 23 | 女 | 22 | 貴州| 20 | 30| | 王麻子 | 23 | 男 | 30| 玉溪 | 30 | 26| | 趙六 | 23 | 女 | 26 | 德州 | 80 | 38 | | 劉能 | 23 | 女 | 19 | 西涼 | 100| 48 | | 段魚 | 23 | 男 | 28 | 廣州 | 60| 52| | 琳娜 | 23 | 男 | 34 | 泰國 | 40| 46| | 貝利 | 23 | 男 | 42 | 美國 | 50| 69 | | 皮特 | 23 | 女 | 50 | 英國 | 38| 70 | | 湯姆 | 23 | 男 | 46 | 緬甸 | 42| 65 | ***** * [ ] 查詢年齡 > 20 的學生 ~~~ model.findAll({ attributes: ['name', 'age'], where: { // age > 20 age: { [Op.gt]:20 } } }) ~~~ ***** * [ ] 查詢年齡 > 20 && < 30 的學生 ~~~ model.findAll({ attributes: ['name', 'age'], where: { age: { [Op.and]: { [Op.gt]:20, [Op.lt]:30 } } } }) `student`.`age` > 20 AND `student`.`age` < 30 ~~~ ***** * [ ] 查詢年齡 in 28 26 52 ~~~ model.findAll({ attributes: ['name', 'age'], where: { age: { [Op.in]: [26,28,52] } } }); `student`.`age` IN (26, 28, 52) ~~~ ***** * [ ] 查詢英語成績為null的 ~~~ model.findAll({ attributes:['name','english'], where: { english: { [Op.is]:null } } }) `student`.`english` IS NULL ~~~ ***** * [ ] 查詢英語成績 IS NOT NULL 不為空 ~~~ Student.findAll({ attributes:['name','english'], where: { english: { [Op.not]:null } } }) `student`.`english` IS NOT NULL ~~~
                  <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>

                              哎呀哎呀视频在线观看