[{"data":1,"prerenderedAt":4469},["ShallowReactive",2],{"navigation":3,"/document/mysql/guide/query":1519,"/document/mysql/guide/query-surround":4464},[4],{"title":5,"path":6,"stem":7,"children":8,"page":50},"Document","/document","document",[9,51,118,150,207,263,307,343,363,403,447,479,518,558,585,609,633,665,700,731,762,794,831,863,899,929,964,1000,1036,1075,1110,1149,1181,1212,1243,1271,1307,1346,1378,1418,1455,1487],{"title":10,"path":11,"stem":12,"children":13,"page":50},"Html5","/document/html5","document/01.html5",[14,42],{"title":15,"path":16,"stem":17,"children":18,"icon":41},"指南","/document/html5/guide","document/01.html5/01.guide/01.index",[19,21,25,29,33,37],{"title":20,"path":16,"stem":17},"HTML 入门教程",{"title":22,"path":23,"stem":24},"常用标签详解","/document/html5/guide/tag","document/01.html5/01.guide/02.tag",{"title":26,"path":27,"stem":28},"布局与语义标签","/document/html5/guide/layout","document/01.html5/01.guide/03.layout",{"title":30,"path":31,"stem":32},"表单设计与用户输入","/document/html5/guide/form","document/01.html5/01.guide/04.form",{"title":34,"path":35,"stem":36},"多媒体与 HTML5 新特性","/document/html5/guide/html5","document/01.html5/01.guide/05.html5",{"title":38,"path":39,"stem":40},"Web 标准与 HTML 编写规范","/document/html5/guide/web","document/01.html5/01.guide/06.web","i-lucide-code",{"title":43,"path":44,"stem":45,"children":46,"icon":49},"考核","/document/html5/examine","document/01.html5/02.examine/01.index",[47],{"title":48,"path":44,"stem":45},"接下来对你进行考核","i-lucide-clipboard-check",false,{"title":52,"path":53,"stem":54,"children":55,"page":50},"Css","/document/css","document/02.css",[56,75,100,113],{"title":57,"path":58,"stem":59,"children":60,"icon":50},"启航","/document/css/guide","document/02.css/01.guide/01.index",[61,63,67,71],{"title":62,"path":58,"stem":59},"CSS 基础入门教程",{"title":64,"path":65,"stem":66},"文本与盒子样式详解","/document/css/guide/styles","document/02.css/01.guide/02.styles",{"title":68,"path":69,"stem":70},"选择器与权重机制","/document/css/guide/selected","document/02.css/01.guide/03.selected",{"title":72,"path":73,"stem":74},"盒模型详解","/document/css/guide/box","document/02.css/01.guide/04.box",{"title":76,"icon":50,"path":77,"stem":78,"children":79,"page":50},"布局","/document/css/layout","document/02.css/02.layout",[80,84,88,92,96],{"title":81,"path":82,"stem":83},"网页布局三剑客详解","/document/css/layout/policy","document/02.css/02.layout/01.policy",{"title":85,"path":86,"stem":87},"Position 定位详解","/document/css/layout/position","document/02.css/02.layout/02.position",{"title":89,"path":90,"stem":91},"Flexbox 布局入门指南","/document/css/layout/flex","document/02.css/02.layout/03.flex",{"title":93,"path":94,"stem":95},"Grid 布局入门指南","/document/css/layout/grid","document/02.css/02.layout/04.grid",{"title":97,"path":98,"stem":99},"响应式设计指南","/document/css/layout/relative","document/02.css/02.layout/05.relative",{"title":101,"icon":50,"path":102,"stem":103,"children":104,"page":50},"使用技巧","/document/css/skill","document/02.css/03.skill",[105,109],{"title":106,"path":107,"stem":108},"CSS 动画全解析","/document/css/skill/animation","document/02.css/03.skill/01.animation",{"title":110,"path":111,"stem":112},"CSS 使用技巧全攻略","/document/css/skill/skill","document/02.css/03.skill/02.skill",{"title":43,"path":114,"stem":115,"children":116,"icon":49},"/document/css/examine","document/02.css/04.examine/01.index",[117],{"title":48,"path":114,"stem":115},{"title":119,"path":120,"stem":121,"children":122,"page":50},"Git","/document/git","document/03.git",[123,145],{"title":57,"path":124,"stem":125,"children":126,"icon":50},"/document/git/guide","document/03.git/01.guide/01.index",[127,129,133,137,141],{"title":128,"path":124,"stem":125},"Git 入门指南",{"title":130,"path":131,"stem":132},"Git 安装与初体验","/document/git/guide/install","document/03.git/01.guide/02.install",{"title":134,"path":135,"stem":136},"常用 Git 命令详解","/document/git/guide/command","document/03.git/01.guide/03.command",{"title":138,"path":139,"stem":140},"Git 分支管理全解析","/document/git/guide/branch","document/03.git/01.guide/04.branch",{"title":142,"path":143,"stem":144},"使用 GitHub 轻松托管和管理代码","/document/git/guide/github","document/03.git/01.guide/05.github",{"title":43,"path":146,"stem":147,"children":148,"icon":49},"/document/git/examine","document/03.git/02.examine/01.index",[149],{"title":48,"path":146,"stem":147},{"title":151,"path":152,"stem":153,"children":154,"page":50},"Js Base","/document/js-base","document/04.js-base",[155,185,202],{"title":15,"path":156,"stem":157,"children":158,"icon":41},"/document/js-base/guide","document/04.js-base/01.guide/01.index",[159,161,165,169,173,177,181],{"title":160,"path":156,"stem":157},"JavaScript 基础快速入门",{"title":162,"path":163,"stem":164},"搞懂变量与数据类型","/document/js-base/guide/variable","document/04.js-base/01.guide/02.variable",{"title":166,"path":167,"stem":168},"JavaScript 运算符详解","/document/js-base/guide/operator","document/04.js-base/01.guide/03.operator",{"title":170,"path":171,"stem":172},"条件判断与循环语句","/document/js-base/guide/flow","document/04.js-base/01.guide/04.flow",{"title":174,"path":175,"stem":176},"深入理解 JavaScript 函数","/document/js-base/guide/function","document/04.js-base/01.guide/05.function",{"title":178,"path":179,"stem":180},"对象数组的创建与操作","/document/js-base/guide/object","document/04.js-base/01.guide/06.object",{"title":182,"path":183,"stem":184},"Math 和 Date 用法详解","/document/js-base/guide/math","document/04.js-base/01.guide/07.math",{"title":186,"icon":41,"path":187,"stem":188,"children":189,"page":50},"浏览器","/document/js-base/browser","document/04.js-base/02.browser",[190,194,198],{"title":191,"path":192,"stem":193},"DOM 操作入门与实战","/document/js-base/browser/dom","document/04.js-base/02.browser/01.dom",{"title":195,"path":196,"stem":197},"浏览器 BOM 基础知识","/document/js-base/browser/bom","document/04.js-base/02.browser/02.bom",{"title":199,"path":200,"stem":201},"JavaScript 事件处理机制","/document/js-base/browser/event","document/04.js-base/02.browser/03.event",{"title":43,"path":203,"stem":204,"children":205,"icon":49},"/document/js-base/examine","document/04.js-base/03.examine/01.index",[206],{"title":48,"path":203,"stem":204},{"title":208,"path":209,"stem":210,"children":211,"page":50},"Js Advanced","/document/js-advanced","document/05.js-advanced",[212,231,249],{"title":213,"path":214,"stem":215,"children":216,"icon":41},"JavaScript 原理","/document/js-advanced/guide","document/05.js-advanced/01.guide/01.index",[217,219,223,227],{"title":218,"path":214,"stem":215},"JavaScript 是怎么运行的？",{"title":220,"path":221,"stem":222},"深入理解函数和作用域","/document/js-advanced/guide/function","document/05.js-advanced/01.guide/02.function",{"title":224,"path":225,"stem":226},"深入理解 this 指向","/document/js-advanced/guide/this","document/05.js-advanced/01.guide/03.this",{"title":228,"path":229,"stem":230},"浅拷贝与深拷贝详解","/document/js-advanced/guide/copy","document/05.js-advanced/01.guide/04.copy",{"title":232,"icon":233,"path":234,"stem":235,"children":236,"page":50},"编程范式","i-lucide-shapes","/document/js-advanced/program","document/05.js-advanced/02.program",[237,241,245],{"title":238,"path":239,"stem":240},"面向对象编程（OOP）","/document/js-advanced/program/object","document/05.js-advanced/02.program/01.object",{"title":242,"path":243,"stem":244},"函数式编程入门","/document/js-advanced/program/fp","document/05.js-advanced/02.program/02.fp",{"title":246,"path":247,"stem":248},"防抖和节流详解","/document/js-advanced/program/debounce","document/05.js-advanced/02.program/03.debounce",{"title":250,"icon":251,"path":252,"stem":253,"children":254,"page":50},"浏览器相关特性","i-lucide-monitor","/document/js-advanced/browser","document/05.js-advanced/03.browser",[255,259],{"title":256,"path":257,"stem":258},"浏览器缓存入门指南","/document/js-advanced/browser/cache","document/05.js-advanced/03.browser/01.cache",{"title":260,"path":261,"stem":262},"Web 存储机制深度剖析","/document/js-advanced/browser/storage","document/05.js-advanced/03.browser/02.storage",{"title":264,"path":265,"stem":266,"children":267,"page":50},"Es6","/document/es6","document/06.es6",[268,302],{"title":213,"path":269,"stem":270,"children":271,"icon":41},"/document/es6/guide","document/06.es6/01.guide/01.index",[272,274,278,282,286,290,294,298],{"title":273,"path":269,"stem":270},"ES6 入门指南",{"title":275,"path":276,"stem":277},"变量声明：let 与 const","/document/es6/guide/const","document/06.es6/01.guide/02.const",{"title":279,"path":280,"stem":281},"箭头函数的用法与特点","/document/es6/guide/arrow","document/06.es6/01.guide/03.arrow",{"title":283,"path":284,"stem":285},"字符串、对象与数组的新特性","/document/es6/guide/enhance","document/06.es6/01.guide/04.enhance",{"title":287,"path":288,"stem":289},"Map 和 Set 的使用方式","/document/es6/guide/set","document/06.es6/01.guide/05.set",{"title":291,"path":292,"stem":293},"Promise 实现异步流程控制","/document/es6/guide/promise","document/06.es6/01.guide/06.promise",{"title":295,"path":296,"stem":297},"ESM 模块化语法解析","/document/es6/guide/esm","document/06.es6/01.guide/07.esm",{"title":299,"path":300,"stem":301},"Class 的定义与继承机制","/document/es6/guide/class","document/06.es6/01.guide/08.class",{"title":43,"path":303,"stem":304,"children":305,"icon":49},"/document/es6/examine","document/06.es6/02.examine/01.index",[306],{"title":48,"path":303,"stem":304},{"title":308,"path":309,"stem":310,"children":311,"page":50},"Js Algorithms","/document/js-algorithms","document/07.js-algorithms",[312,338],{"title":15,"path":313,"stem":314,"children":315,"icon":41},"/document/js-algorithms/guide","document/07.js-algorithms/01.guide/01.index",[316,318,322,326,330,334],{"title":317,"path":313,"stem":314},"什么是数据结构和算法？",{"title":319,"path":320,"stem":321},"时间和空间复杂度","/document/js-algorithms/guide/complexity","document/07.js-algorithms/01.guide/02.complexity",{"title":323,"path":324,"stem":325},"数据结构","/document/js-algorithms/guide/structure","document/07.js-algorithms/01.guide/03.structure",{"title":327,"path":328,"stem":329},"算法","/document/js-algorithms/guide/algorithms","document/07.js-algorithms/01.guide/04.algorithms",{"title":331,"path":332,"stem":333},"算法思想","/document/js-algorithms/guide/heuristic","document/07.js-algorithms/01.guide/05.heuristic",{"title":335,"path":336,"stem":337},"深度优先与广度优先搜索","/document/js-algorithms/guide/search","document/07.js-algorithms/01.guide/06.search",{"title":43,"path":339,"stem":340,"children":341,"icon":49},"/document/js-algorithms/examine","document/07.js-algorithms/02.examine/01.index",[342],{"title":48,"path":339,"stem":340},{"title":344,"path":345,"stem":346,"children":347,"page":50},"Automation","/document/automation","document/08.automation",[348,358],{"title":15,"path":349,"stem":350,"children":351,"icon":41},"/document/automation/guide","document/08.automation/01.guide/01.index",[352,354],{"title":353,"path":349,"stem":350},"什么是前端工程化？",{"title":355,"path":356,"stem":357},"开始搭建工程化项目","/document/automation/guide/start","document/08.automation/01.guide/02.start",{"title":43,"path":359,"stem":360,"children":361,"icon":49},"/document/automation/examine","document/08.automation/02.examine/01.index",[362],{"title":48,"path":359,"stem":360},{"title":364,"path":365,"stem":366,"children":367,"page":50},"Webpack","/document/webpack","document/09.webpack",[368,398],{"title":15,"path":369,"stem":370,"children":371,"icon":41},"/document/webpack/guide","document/09.webpack/01.guide/01.index",[372,374,378,382,386,390,394],{"title":373,"path":369,"stem":370},"Webpack 初识",{"title":375,"path":376,"stem":377},"搭建 Webpack 项目","/document/webpack/guide/start","document/09.webpack/01.guide/02.start",{"title":379,"path":380,"stem":381},"Loader 加载器","/document/webpack/guide/loader","document/09.webpack/01.guide/03.loader",{"title":383,"path":384,"stem":385},"Plugin 插件","/document/webpack/guide/plugin","document/09.webpack/01.guide/04.plugin",{"title":387,"path":388,"stem":389},"HMR 热更新与开发模式","/document/webpack/guide/dev","document/09.webpack/01.guide/05.dev",{"title":391,"path":392,"stem":393},"性能优化配置","/document/webpack/guide/optimize","document/09.webpack/01.guide/06.optimize",{"title":395,"path":396,"stem":397},"webpack 生产环境构建全攻略","/document/webpack/guide/production","document/09.webpack/01.guide/07.production",{"title":43,"path":399,"stem":400,"children":401,"icon":49},"/document/webpack/examine","document/09.webpack/02.examine/01.index",[402],{"title":48,"path":399,"stem":400},{"title":404,"path":405,"stem":406,"children":407,"page":50},"Scss","/document/scss","document/10.scss",[408,442],{"title":15,"path":409,"stem":410,"children":411,"icon":41},"/document/scss/guide","document/10.scss/01.guide/01.index",[412,414,418,422,426,430,434,438],{"title":413,"path":409,"stem":410},"什么是 SCSS？",{"title":415,"path":416,"stem":417},"SCSS 入门语法基础","/document/scss/guide/syntax","document/10.scss/01.guide/02.syntax",{"title":419,"path":420,"stem":421},"开始编写 Scss 项目","/document/scss/guide/start","document/10.scss/01.guide/03.start",{"title":423,"path":424,"stem":425},"Scss 模块导入方式","/document/scss/guide/import","document/10.scss/01.guide/04.import",{"title":427,"path":428,"stem":429},"Mixin 与函数详解","/document/scss/guide/mixin","document/10.scss/01.guide/05.mixin",{"title":431,"path":432,"stem":433},"Scss 继承、占位符技巧","/document/scss/guide/extend","document/10.scss/01.guide/06.extend",{"title":435,"path":436,"stem":437},"SCSS 流程控制与逻辑语法","/document/scss/guide/flow","document/10.scss/01.guide/07.flow",{"title":439,"path":440,"stem":441},"SCSS 内置函数","/document/scss/guide/function","document/10.scss/01.guide/08.function",{"title":43,"path":443,"stem":444,"children":445,"icon":49},"/document/scss/examine","document/10.scss/02.examine/01.index",[446],{"title":48,"path":443,"stem":444},{"title":448,"path":449,"stem":450,"children":451,"page":50},"Eslint","/document/eslint","document/11.eslint",[452,474],{"title":15,"path":453,"stem":454,"children":455,"icon":41},"/document/eslint/guide","document/11.eslint/01.guide/01.index",[456,458,462,466,470],{"title":457,"path":453,"stem":454},"ESLint 是什么？",{"title":459,"path":460,"stem":461},"ESLint 安装与运行详解","/document/eslint/guide/install","document/11.eslint/01.guide/02.install",{"title":463,"path":464,"stem":465},"ESLint  规则介绍","/document/eslint/guide/rule","document/11.eslint/01.guide/03.rule",{"title":467,"path":468,"stem":469},"集成 ESLint 到 Webpack","/document/eslint/guide/webpack","document/11.eslint/01.guide/04.webpack",{"title":471,"path":472,"stem":473},"Plugins 和 Extends 使用","/document/eslint/guide/plugins","document/11.eslint/01.guide/05.plugins",{"title":43,"path":475,"stem":476,"children":477,"icon":49},"/document/eslint/examine","document/11.eslint/02.examine/01.index",[478],{"title":48,"path":475,"stem":476},{"title":480,"path":481,"stem":482,"children":483,"page":50},"Axios","/document/axios","document/12.axios",[484,494,513],{"title":15,"path":485,"stem":486,"children":487,"icon":41},"/document/axios/guide","document/12.axios/01.guide/01.index",[488,490],{"title":489,"path":485,"stem":486},"HTTP 协议与网络请求",{"title":491,"path":492,"stem":493},"使用 JavaScript 发起请求","/document/axios/guide/get","document/12.axios/01.guide/02.get",{"title":495,"path":496,"stem":497,"children":498,"icon":41},"axios 插件","/document/axios/axios","document/12.axios/02.axios/01.index",[499,501,505,509],{"title":500,"path":496,"stem":497},"Axios 入门",{"title":502,"path":503,"stem":504},"Axios 请求基础全面讲解","/document/axios/axios/start","document/12.axios/02.axios/02.start",{"title":506,"path":507,"stem":508},"Axios 高级使用技巧","/document/axios/axios/advenced","document/12.axios/02.axios/03.advenced",{"title":510,"path":511,"stem":512},"CORS 跨域解决方案","/document/axios/axios/cors","document/12.axios/02.axios/04.cors",{"title":43,"path":514,"stem":515,"children":516,"icon":49},"/document/axios/examine","document/12.axios/03.examine/01.index",[517],{"title":48,"path":514,"stem":515},{"title":519,"path":520,"stem":521,"children":522,"page":50},"Typescript","/document/typescript","document/13.typescript",[523,553],{"title":15,"path":524,"stem":525,"children":526,"icon":41},"/document/typescript/guide","document/13.typescript/01.guide/01.index",[527,529,533,537,541,545,549],{"title":528,"path":524,"stem":525},"TypeScript 简介与入门",{"title":530,"path":531,"stem":532},"类型系统基础","/document/typescript/guide/base","document/13.typescript/01.guide/02.base",{"title":534,"path":535,"stem":536},"类型组合与类型保护","/document/typescript/guide/compose","document/13.typescript/01.guide/03.compose",{"title":538,"path":539,"stem":540},"类与面向对象编程","/document/typescript/guide/class","document/13.typescript/01.guide/04.class",{"title":542,"path":543,"stem":544},"泛型与类型复用","/document/typescript/guide/generic","document/13.typescript/01.guide/05.generic",{"title":546,"path":547,"stem":548},"项目进阶与配置实战","/document/typescript/guide/config","document/13.typescript/01.guide/06.config",{"title":550,"path":551,"stem":552},"第三方库类型支持与声明","/document/typescript/guide/declare","document/13.typescript/01.guide/07.declare",{"title":43,"path":554,"stem":555,"children":556,"icon":49},"/document/typescript/examine","document/13.typescript/02.examine/01.index",[557],{"title":48,"path":554,"stem":555},{"title":559,"path":560,"stem":561,"children":562,"page":50},"Vue2","/document/vue2","document/14.vue2",[563],{"title":15,"path":564,"stem":565,"children":566,"icon":41},"/document/vue2/guide","document/14.vue2/01.guide/01.index",[567,569,573,577,581],{"title":568,"path":564,"stem":565},"Vue 2 入门与安装",{"title":570,"path":571,"stem":572},"模板语法与指令详解","/document/vue2/guide/directive","document/14.vue2/01.guide/02.directive",{"title":574,"path":575,"stem":576},"组件化开发基础","/document/vue2/guide/component","document/14.vue2/01.guide/03.component",{"title":578,"path":579,"stem":580},"计算属性与监听器","/document/vue2/guide/reactive","document/14.vue2/01.guide/04.reactive",{"title":582,"path":583,"stem":584},"生命周期钩子解析","/document/vue2/guide/hooks","document/14.vue2/01.guide/05.hooks",{"title":586,"path":587,"stem":588,"children":589,"page":50},"Router","/document/router","document/15.router",[590],{"title":591,"path":592,"stem":593,"children":594,"icon":41},"Vue Router 路由","/document/router/guide","document/15.router/01.guide/01.index",[595,597,601,605],{"title":596,"path":592,"stem":593},"Vue Router 入门",{"title":598,"path":599,"stem":600},"路由核心功能详解","/document/router/guide/routing","document/15.router/01.guide/02.routing",{"title":602,"path":603,"stem":604},"路由守卫钩子和元信息","/document/router/guide/hook","document/15.router/01.guide/03.hook",{"title":606,"path":607,"stem":608},"路由优化与懒加载","/document/router/guide/optimize","document/15.router/01.guide/04.optimize",{"title":610,"path":611,"stem":612,"children":613,"page":50},"Vuex","/document/vuex","document/16.vuex",[614],{"title":615,"path":616,"stem":617,"children":618,"icon":41},"Vuex 状态管理器","/document/vuex/guide","document/16.vuex/01.guide/01.index",[619,621,625,629],{"title":620,"path":616,"stem":617},"为什么要使用 Vuex？",{"title":622,"path":623,"stem":624},"快速上手 Vuex","/document/vuex/guide/start","document/16.vuex/01.guide/02.start",{"title":626,"path":627,"stem":628},"深入理解 Vuex 核心功能","/document/vuex/guide/core","document/16.vuex/01.guide/03.core",{"title":630,"path":631,"stem":632},"模块化与进阶用法","/document/vuex/guide/module","document/16.vuex/01.guide/04.module",{"title":634,"path":635,"stem":636,"children":637,"page":50},"Element Ui","/document/element-ui","document/17.element-ui",[638],{"title":639,"path":640,"stem":641,"children":642,"icon":41},"Element UI 组件库","/document/element-ui/guide","document/17.element-ui/01.guide/01.index",[643,645,649,653,657,661],{"title":644,"path":640,"stem":641},"Element UI 初体验",{"title":646,"path":647,"stem":648},"常用组件快速上手","/document/element-ui/guide/quickstart","document/17.element-ui/01.guide/02.quickstart",{"title":650,"path":651,"stem":652},"布局与结构类组件","/document/element-ui/guide/layout","document/17.element-ui/01.guide/03.layout",{"title":654,"path":655,"stem":656},"自定义组件样式","/document/element-ui/guide/style","document/17.element-ui/01.guide/04.style",{"title":658,"path":659,"stem":660},"组件封装与复用","/document/element-ui/guide/component","document/17.element-ui/01.guide/05.component",{"title":662,"path":663,"stem":664},"自定义主题色与深色模式","/document/element-ui/guide/theme","document/17.element-ui/01.guide/06.theme",{"title":666,"path":667,"stem":668,"children":669,"page":50},"Vue3","/document/vue3","document/18.vue3",[670],{"title":666,"path":671,"stem":672,"children":673,"icon":41},"/document/vue3/guide","document/18.vue3/01.guide/01.index",[674,676,680,684,688,692,696],{"title":675,"path":671,"stem":672},"Vue 3 概览与生态升级",{"title":677,"path":678,"stem":679},"组合式 API 入门指南","/document/vue3/guide/composition","document/18.vue3/01.guide/02.composition",{"title":681,"path":682,"stem":683},"组合式 API 逻辑抽离","/document/vue3/guide/composable","document/18.vue3/01.guide/03.composable",{"title":685,"path":686,"stem":687},"模板语法及新特性","/document/vue3/guide/features","document/18.vue3/01.guide/04.features",{"title":689,"path":690,"stem":691},"TypeScript 开发支持","/document/vue3/guide/typescript","document/18.vue3/01.guide/05.typescript",{"title":693,"path":694,"stem":695},"响应式系统原理与进阶 API","/document/vue3/guide/reactive","document/18.vue3/01.guide/06.reactive",{"title":697,"path":698,"stem":699},"Vue Router 4 路由实战","/document/vue3/guide/vue-router","document/18.vue3/01.guide/07.vue-router",{"title":701,"path":702,"stem":703,"children":704,"page":50},"Pinia","/document/pinia","document/19.pinia",[705],{"title":701,"path":706,"stem":707,"children":708,"icon":41},"/document/pinia/guide","document/19.pinia/01.guide/01.index",[709,711,715,719,723,727],{"title":710,"path":706,"stem":707},"Pinia 简介与安装",{"title":712,"path":713,"stem":714},"Store 三大核心","/document/pinia/guide/store","document/19.pinia/01.guide/02.store",{"title":716,"path":717,"stem":718},"在组件中使用 Store","/document/pinia/guide/usage","document/19.pinia/01.guide/03.usage",{"title":720,"path":721,"stem":722},"State 修改与响应式细节","/document/pinia/guide/state","document/19.pinia/01.guide/04.state",{"title":724,"path":725,"stem":726},"Action 与异步操作","/document/pinia/guide/action","document/19.pinia/01.guide/05.action",{"title":728,"path":729,"stem":730},"组合、TypeScript 与插件","/document/pinia/guide/advanced","document/19.pinia/01.guide/06.advanced",{"title":732,"path":733,"stem":734,"children":735,"page":50},"Vite","/document/vite","document/20.vite",[736],{"title":732,"path":737,"stem":738,"children":739,"icon":41},"/document/vite/guide","document/20.vite/01.guide/01.index",[740,742,746,750,754,758],{"title":741,"path":737,"stem":738},"Vite 简介与安装",{"title":743,"path":744,"stem":745},"基础配置","/document/vite/guide/config","document/20.vite/01.guide/02.config",{"title":747,"path":748,"stem":749},"常用插件","/document/vite/guide/plugins","document/20.vite/01.guide/03.plugins",{"title":751,"path":752,"stem":753},"环境变量与模式","/document/vite/guide/env","document/20.vite/01.guide/04.env",{"title":755,"path":756,"stem":757},"依赖预构建","/document/vite/guide/optimize-deps","document/20.vite/01.guide/05.optimize-deps",{"title":759,"path":760,"stem":761},"构建与部署","/document/vite/guide/build-deploy","document/20.vite/01.guide/06.build-deploy",{"title":763,"path":764,"stem":765,"children":766,"page":50},"Nuxt","/document/nuxt","document/21.nuxt",[767],{"title":768,"path":769,"stem":770,"children":771,"icon":41},"Nuxt.js","/document/nuxt/guide","document/21.nuxt/01.guide/01.index",[772,774,778,782,786,790],{"title":773,"path":769,"stem":770},"Nuxt.js 简介与安装",{"title":775,"path":776,"stem":777},"目录约定与自动导入","/document/nuxt/guide/directory-and-auto-imports","document/21.nuxt/01.guide/02.directory-and-auto-imports",{"title":779,"path":780,"stem":781},"文件路由与导航","/document/nuxt/guide/routing","document/21.nuxt/01.guide/03.routing",{"title":783,"path":784,"stem":785},"数据获取","/document/nuxt/guide/data-fetching","document/21.nuxt/01.guide/04.data-fetching",{"title":787,"path":788,"stem":789},"状态管理","/document/nuxt/guide/state-management","document/21.nuxt/01.guide/05.state-management",{"title":791,"path":792,"stem":793},"配置与部署","/document/nuxt/guide/config-and-deploy","document/21.nuxt/01.guide/06.config-and-deploy",{"title":795,"path":796,"stem":797,"children":798,"page":50},"Npm","/document/npm","document/22.npm",[799],{"title":800,"path":801,"stem":802,"children":803,"icon":830},"NPM","/document/npm/guide","document/22.npm/01.guide/01.index",[804,806,810,814,818,822,826],{"title":805,"path":801,"stem":802},"NPM 入门",{"title":807,"path":808,"stem":809},"package.json 详解","/document/npm/guide/package-json","document/22.npm/01.guide/02.package-json",{"title":811,"path":812,"stem":813},"安装命令与版本","/document/npm/guide/install-commands","document/22.npm/01.guide/03.install-commands",{"title":815,"path":816,"stem":817},"scripts 与 npx","/document/npm/guide/scripts-and-npx","document/22.npm/01.guide/04.scripts-and-npx",{"title":819,"path":820,"stem":821},"发布包与镜像源","/document/npm/guide/publish-and-registry","document/22.npm/01.guide/05.publish-and-registry",{"title":823,"path":824,"stem":825},"lock 文件与清理","/document/npm/guide/lock-and-clean","document/22.npm/01.guide/06.lock-and-clean",{"title":827,"path":828,"stem":829},"Yarn 与 pnpm","/document/npm/guide/yarn-and-pnpm","document/22.npm/01.guide/07.yarn-and-pnpm","i-simple-icons-npm",{"title":832,"icon":833,"path":834,"stem":835,"children":836,"page":50},"Handlebars","i-simple-icons-handlebarsdotjs","/document/handlebars","document/23.handlebars",[837],{"title":838,"path":839,"stem":840,"children":841},"Handlebars 简介","/document/handlebars/guide","document/23.handlebars/01.guide/01.index",[842,843,847,851,855,859],{"title":838,"path":839,"stem":840},{"title":844,"path":845,"stem":846},"基本语法","/document/handlebars/guide/syntax","document/23.handlebars/01.guide/02.syntax",{"title":848,"path":849,"stem":850},"内置辅助函数","/document/handlebars/guide/builtins","document/23.handlebars/01.guide/03.builtins",{"title":852,"path":853,"stem":854},"模板复用","/document/handlebars/guide/partials","document/23.handlebars/01.guide/04.partials",{"title":856,"path":857,"stem":858},"自定义 Helpers","/document/handlebars/guide/helpers","document/23.handlebars/01.guide/05.helpers",{"title":860,"path":861,"stem":862},"预编译与运行时","/document/handlebars/guide/runtime","document/23.handlebars/01.guide/06.runtime",{"title":864,"icon":865,"path":866,"stem":867,"children":868,"page":50},"Plop","i-simple-icons-nodedotjs","/document/plop","document/24.plop",[869],{"title":870,"path":871,"stem":872,"children":873},"Plop 简介","/document/plop/guide","document/24.plop/01.guide/01.index",[874,875,879,883,887,891,895],{"title":870,"path":871,"stem":872},{"title":876,"path":877,"stem":878},"第一个生成器","/document/plop/guide/plopfile","document/24.plop/01.guide/02.plopfile",{"title":880,"path":881,"stem":882},"交互式询问","/document/plop/guide/prompts","document/24.plop/01.guide/03.prompts",{"title":884,"path":885,"stem":886},"核心动作","/document/plop/guide/actions","document/24.plop/01.guide/04.actions",{"title":888,"path":889,"stem":890},"模板文件组织","/document/plop/guide/templates","document/24.plop/01.guide/05.templates",{"title":892,"path":893,"stem":894},"Helper 扩展","/document/plop/guide/helpers","document/24.plop/01.guide/06.helpers",{"title":896,"path":897,"stem":898},"组件生成实战","/document/plop/guide/practice","document/24.plop/01.guide/07.practice",{"title":900,"icon":901,"path":902,"stem":903,"children":904,"page":50},"Rollup","i-simple-icons-rollupdotjs","/document/rollup","document/25.rollup",[905],{"title":906,"path":907,"stem":908,"children":909},"Rollup 简介","/document/rollup/guide","document/25.rollup/01.guide/01.index",[910,911,914,918,921,925],{"title":906,"path":907,"stem":908},{"title":743,"path":912,"stem":913},"/document/rollup/guide/config","document/25.rollup/01.guide/02.config",{"title":915,"path":916,"stem":917},"输出格式","/document/rollup/guide/formats","document/25.rollup/01.guide/03.formats",{"title":747,"path":919,"stem":920},"/document/rollup/guide/plugins","document/25.rollup/01.guide/04.plugins",{"title":922,"path":923,"stem":924},"Tree Shaking","/document/rollup/guide/tree-shaking","document/25.rollup/01.guide/05.tree-shaking",{"title":926,"path":927,"stem":928},"打包工具库实战","/document/rollup/guide/library","document/25.rollup/01.guide/06.library",{"title":930,"icon":865,"path":931,"stem":932,"children":933,"page":50},"Snabbdom","/document/snabbdom","document/26.snabbdom",[934],{"title":935,"path":936,"stem":937,"children":938},"Snabbdom 简介","/document/snabbdom/guide","document/26.snabbdom/01.guide/01.index",[939,940,944,948,952,956,960],{"title":935,"path":936,"stem":937},{"title":941,"path":942,"stem":943},"h 函数","/document/snabbdom/guide/h","document/26.snabbdom/01.guide/02.h",{"title":945,"path":946,"stem":947},"模块机制","/document/snabbdom/guide/modules","document/26.snabbdom/01.guide/03.modules",{"title":949,"path":950,"stem":951},"patch 渲染与更新","/document/snabbdom/guide/patch","document/26.snabbdom/01.guide/04.patch",{"title":953,"path":954,"stem":955},"key 的作用","/document/snabbdom/guide/key","document/26.snabbdom/01.guide/05.key",{"title":957,"path":958,"stem":959},"Diff 原理","/document/snabbdom/guide/diff","document/26.snabbdom/01.guide/06.diff",{"title":961,"path":962,"stem":963},"手写迷你虚拟 DOM","/document/snabbdom/guide/practice","document/26.snabbdom/01.guide/07.practice",{"title":965,"icon":966,"path":967,"stem":968,"children":969,"page":50},"Vercel","i-simple-icons-vercel","/document/vercel","document/27.vercel",[970],{"title":971,"path":972,"stem":973,"children":974},"Vercel 简介","/document/vercel/guide","document/27.vercel/01.guide/01.index",[975,976,980,984,988,992,996],{"title":971,"path":972,"stem":973},{"title":977,"path":978,"stem":979},"Vercel CLI","/document/vercel/guide/cli","document/27.vercel/01.guide/02.cli",{"title":981,"path":982,"stem":983},"项目设置与环境变量","/document/vercel/guide/settings","document/27.vercel/01.guide/03.settings",{"title":985,"path":986,"stem":987},"预览部署与回滚","/document/vercel/guide/preview","document/27.vercel/01.guide/04.preview",{"title":989,"path":990,"stem":991},"自定义域名","/document/vercel/guide/domain","document/27.vercel/01.guide/05.domain",{"title":993,"path":994,"stem":995},"vercel.json 配置","/document/vercel/guide/vercel-json","document/27.vercel/01.guide/06.vercel-json",{"title":997,"path":998,"stem":999},"Serverless Functions","/document/vercel/guide/serverless","document/27.vercel/01.guide/07.serverless",{"title":1001,"icon":1002,"path":1003,"stem":1004,"children":1005,"page":50},"ECharts","i-simple-icons-apacheecharts","/document/echarts","document/28.echarts",[1006],{"title":1007,"path":1008,"stem":1009,"children":1010},"ECharts 简介","/document/echarts/guide","document/28.echarts/01.guide/01.index",[1011,1012,1016,1020,1024,1028,1032],{"title":1007,"path":1008,"stem":1009},{"title":1013,"path":1014,"stem":1015},"核心配置项","/document/echarts/guide/option","document/28.echarts/01.guide/02.option",{"title":1017,"path":1018,"stem":1019},"常用图表类型","/document/echarts/guide/charts","document/28.echarts/01.guide/03.charts",{"title":1021,"path":1022,"stem":1023},"样式与主题","/document/echarts/guide/style","document/28.echarts/01.guide/04.style",{"title":1025,"path":1026,"stem":1027},"交互与事件","/document/echarts/guide/interaction","document/28.echarts/01.guide/05.interaction",{"title":1029,"path":1030,"stem":1031},"动态数据","/document/echarts/guide/data","document/28.echarts/01.guide/06.data",{"title":1033,"path":1034,"stem":1035},"Vue3 实战","/document/echarts/guide/vue","document/28.echarts/01.guide/07.vue",{"title":1037,"icon":1038,"path":1039,"stem":1040,"children":1041,"page":50},"D3","i-simple-icons-d3dotjs","/document/d3","document/29.d3",[1042],{"title":1043,"path":1044,"stem":1045,"children":1046},"D3 简介","/document/d3/guide","document/29.d3/01.guide/01.index",[1047,1048,1052,1056,1060,1064,1068,1072],{"title":1043,"path":1044,"stem":1045},{"title":1049,"path":1050,"stem":1051},"选择集与数据绑定","/document/d3/guide/selection","document/29.d3/01.guide/02.selection",{"title":1053,"path":1054,"stem":1055},"比例尺","/document/d3/guide/scale","document/29.d3/01.guide/03.scale",{"title":1057,"path":1058,"stem":1059},"坐标轴","/document/d3/guide/axis","document/29.d3/01.guide/04.axis",{"title":1061,"path":1062,"stem":1063},"图形生成器","/document/d3/guide/shape","document/29.d3/01.guide/05.shape",{"title":1065,"path":1066,"stem":1067},"过渡动画","/document/d3/guide/transition","document/29.d3/01.guide/06.transition",{"title":1069,"path":1070,"stem":1071},"交互与缩放","/document/d3/guide/interaction","document/29.d3/01.guide/07.interaction",{"title":1033,"path":1073,"stem":1074},"/document/d3/guide/vue","document/29.d3/01.guide/08.vue",{"title":1076,"icon":1077,"path":1078,"stem":1079,"children":1080,"page":50},"Three.js","i-simple-icons-threedotjs","/document/threejs","document/30.threejs",[1081],{"title":1082,"path":1083,"stem":1084,"children":1085},"Three.js 简介","/document/threejs/guide","document/30.threejs/01.guide/01.index",[1086,1087,1091,1095,1099,1103,1107],{"title":1082,"path":1083,"stem":1084},{"title":1088,"path":1089,"stem":1090},"几何体与材质","/document/threejs/guide/geometry","document/30.threejs/01.guide/02.geometry",{"title":1092,"path":1093,"stem":1094},"灯光与阴影","/document/threejs/guide/light","document/30.threejs/01.guide/03.light",{"title":1096,"path":1097,"stem":1098},"相机与坐标系","/document/threejs/guide/camera","document/30.threejs/01.guide/04.camera",{"title":1100,"path":1101,"stem":1102},"动画与渲染循环","/document/threejs/guide/animation","document/30.threejs/01.guide/05.animation",{"title":1104,"path":1105,"stem":1106},"轨道控制器","/document/threejs/guide/control","document/30.threejs/01.guide/06.control",{"title":1033,"path":1108,"stem":1109},"/document/threejs/guide/vue","document/30.threejs/01.guide/07.vue",{"title":1111,"icon":865,"path":1112,"stem":1113,"children":1114,"page":50},"Node.js","/document/nodejs","document/32.nodejs",[1115],{"title":1116,"path":1117,"stem":1118,"children":1119},"Node.js 简介","/document/nodejs/guide","document/32.nodejs/01.guide/01.index",[1120,1121,1125,1129,1133,1137,1141,1145],{"title":1116,"path":1117,"stem":1118},{"title":1122,"path":1123,"stem":1124},"模块化","/document/nodejs/guide/module","document/32.nodejs/01.guide/02.module",{"title":1126,"path":1127,"stem":1128},"fs 文件系统","/document/nodejs/guide/fs","document/32.nodejs/01.guide/03.fs",{"title":1130,"path":1131,"stem":1132},"path 路径模块","/document/nodejs/guide/path","document/32.nodejs/01.guide/04.path",{"title":1134,"path":1135,"stem":1136},"http 搭建服务器","/document/nodejs/guide/http","document/32.nodejs/01.guide/05.http",{"title":1138,"path":1139,"stem":1140},"事件循环","/document/nodejs/guide/event-loop","document/32.nodejs/01.guide/06.event-loop",{"title":1142,"path":1143,"stem":1144},"process 与环境变量","/document/nodejs/guide/process","document/32.nodejs/01.guide/07.process",{"title":1146,"path":1147,"stem":1148},"events 事件模块","/document/nodejs/guide/events","document/32.nodejs/01.guide/08.events",{"title":1150,"icon":1151,"path":1152,"stem":1153,"children":1154,"page":50},"Express","i-simple-icons-express","/document/express","document/33.express",[1155],{"title":1156,"path":1157,"stem":1158,"children":1159},"Express 简介","/document/express/guide","document/33.express/01.guide/01.index",[1160,1161,1165,1169,1173,1177],{"title":1156,"path":1157,"stem":1158},{"title":1162,"path":1163,"stem":1164},"路由","/document/express/guide/routing","document/33.express/01.guide/02.routing",{"title":1166,"path":1167,"stem":1168},"中间件","/document/express/guide/middleware","document/33.express/01.guide/03.middleware",{"title":1170,"path":1171,"stem":1172},"请求与响应","/document/express/guide/request-response","document/33.express/01.guide/04.request-response",{"title":1174,"path":1175,"stem":1176},"错误处理","/document/express/guide/error-handling","document/33.express/01.guide/05.error-handling",{"title":1178,"path":1179,"stem":1180},"RESTful 实战","/document/express/guide/restful-api","document/33.express/01.guide/06.restful-api",{"title":1182,"icon":1183,"path":1184,"stem":1185,"children":1186,"page":50},"Koa","i-simple-icons-koa","/document/koa","document/34.koa",[1187],{"title":1188,"path":1189,"stem":1190,"children":1191},"Koa 简介","/document/koa/guide","document/34.koa/01.guide/01.index",[1192,1193,1197,1201,1204,1208],{"title":1188,"path":1189,"stem":1190},{"title":1194,"path":1195,"stem":1196},"Context 上下文","/document/koa/guide/context","document/34.koa/01.guide/02.context",{"title":1198,"path":1199,"stem":1200},"中间件与洋葱模型","/document/koa/guide/middleware","document/34.koa/01.guide/03.middleware",{"title":1162,"path":1202,"stem":1203},"/document/koa/guide/routing","document/34.koa/01.guide/04.routing",{"title":1205,"path":1206,"stem":1207},"请求体与错误处理","/document/koa/guide/body-and-error","document/34.koa/01.guide/05.body-and-error",{"title":1209,"path":1210,"stem":1211},"RESTful 接口实战","/document/koa/guide/restful-api","document/34.koa/01.guide/06.restful-api",{"title":1213,"icon":1214,"path":1215,"stem":1216,"children":1217,"page":50},"Egg.js","i-lucide-egg","/document/egg","document/35.egg",[1218],{"title":1219,"path":1220,"stem":1221,"children":1222},"Egg.js 简介","/document/egg/guide","document/35.egg/01.guide/01.index",[1223,1224,1228,1232,1236,1240],{"title":1219,"path":1220,"stem":1221},{"title":1225,"path":1226,"stem":1227},"路由与 Controller","/document/egg/guide/router-controller","document/35.egg/01.guide/02.router-controller",{"title":1229,"path":1230,"stem":1231},"Service 业务逻辑","/document/egg/guide/service","document/35.egg/01.guide/03.service",{"title":1233,"path":1234,"stem":1235},"配置与中间件","/document/egg/guide/config-middleware","document/35.egg/01.guide/04.config-middleware",{"title":1237,"path":1238,"stem":1239},"插件与扩展","/document/egg/guide/plugin-extend","document/35.egg/01.guide/05.plugin-extend",{"title":1209,"path":1241,"stem":1242},"/document/egg/guide/restful-api","document/35.egg/01.guide/06.restful-api",{"title":1244,"icon":1245,"path":1246,"stem":1247,"children":1248,"page":50},"Docker","i-simple-icons-docker","/document/docker","document/36.docker",[1249],{"title":1250,"path":1251,"stem":1252,"children":1253},"Docker 简介","/document/docker/guide","document/36.docker/01.guide/01.index",[1254,1255,1259,1263,1267],{"title":1250,"path":1251,"stem":1252},{"title":1256,"path":1257,"stem":1258},"镜像与容器","/document/docker/guide/image-container","document/36.docker/01.guide/02.image-container",{"title":1260,"path":1261,"stem":1262},"数据卷","/document/docker/guide/volume","document/36.docker/01.guide/03.volume",{"title":1264,"path":1265,"stem":1266},"Dockerfile","/document/docker/guide/dockerfile","document/36.docker/01.guide/04.dockerfile",{"title":1268,"path":1269,"stem":1270},"Docker Compose","/document/docker/guide/docker-compose","document/36.docker/01.guide/05.docker-compose",{"title":1272,"icon":1273,"path":1274,"stem":1275,"children":1276,"page":50},"MySQL","i-simple-icons-mysql","/document/mysql","document/37.mysql",[1277],{"title":1278,"path":1279,"stem":1280,"children":1281},"MySQL 简介","/document/mysql/guide","document/37.mysql/01.guide/01.index",[1282,1283,1287,1291,1295,1299,1303],{"title":1278,"path":1279,"stem":1280},{"title":1284,"path":1285,"stem":1286},"增删改查","/document/mysql/guide/crud","document/37.mysql/01.guide/02.crud",{"title":1288,"path":1289,"stem":1290},"条件查询与分页","/document/mysql/guide/query","document/37.mysql/01.guide/03.query",{"title":1292,"path":1293,"stem":1294},"数据类型与约束","/document/mysql/guide/data-type","document/37.mysql/01.guide/04.data-type",{"title":1296,"path":1297,"stem":1298},"多表关联查询","/document/mysql/guide/join","document/37.mysql/01.guide/05.join",{"title":1300,"path":1301,"stem":1302},"Node.js 操作 MySQL","/document/mysql/guide/nodejs","document/37.mysql/01.guide/06.nodejs",{"title":1304,"path":1305,"stem":1306},"索引与优化","/document/mysql/guide/optimize","document/37.mysql/01.guide/07.optimize",{"title":1308,"icon":1309,"path":1310,"stem":1311,"children":1312,"page":50},"MongoDB","i-simple-icons-mongodb","/document/mongodb","document/38.mongodb",[1313],{"title":1314,"path":1315,"stem":1316,"children":1317},"MongoDB 简介","/document/mongodb/guide","document/38.mongodb/01.guide/01.index",[1318,1319,1322,1326,1330,1334,1338,1342],{"title":1314,"path":1315,"stem":1316},{"title":1284,"path":1320,"stem":1321},"/document/mongodb/guide/crud","document/38.mongodb/01.guide/02.crud",{"title":1323,"path":1324,"stem":1325},"条件查询","/document/mongodb/guide/query","document/38.mongodb/01.guide/03.query",{"title":1327,"path":1328,"stem":1329},"文档与数据类型","/document/mongodb/guide/document","document/38.mongodb/01.guide/04.document",{"title":1331,"path":1332,"stem":1333},"Node.js 操作 MongoDB","/document/mongodb/guide/nodejs","document/38.mongodb/01.guide/05.nodejs",{"title":1335,"path":1336,"stem":1337},"Mongoose","/document/mongodb/guide/mongoose","document/38.mongodb/01.guide/06.mongoose",{"title":1339,"path":1340,"stem":1341},"索引","/document/mongodb/guide/optimize","document/38.mongodb/01.guide/07.optimize",{"title":1343,"path":1344,"stem":1345},"聚合管道","/document/mongodb/guide/aggregate","document/38.mongodb/01.guide/08.aggregate",{"title":1347,"icon":1348,"path":1349,"stem":1350,"children":1351,"page":50},"GraphQL","i-simple-icons-graphql","/document/graphql","document/39.graphql",[1352],{"title":1353,"path":1354,"stem":1355,"children":1356},"GraphQL 简介","/document/graphql/guide","document/39.graphql/01.guide/01.index",[1357,1358,1362,1366,1370,1374],{"title":1353,"path":1354,"stem":1355},{"title":1359,"path":1360,"stem":1361},"类型系统","/document/graphql/guide/schema","document/39.graphql/01.guide/02.schema",{"title":1363,"path":1364,"stem":1365},"查询进阶","/document/graphql/guide/query","document/39.graphql/01.guide/03.query",{"title":1367,"path":1368,"stem":1369},"Mutation 增删改","/document/graphql/guide/mutation","document/39.graphql/01.guide/04.mutation",{"title":1371,"path":1372,"stem":1373},"Express 集成","/document/graphql/guide/express","document/39.graphql/01.guide/05.express",{"title":1375,"path":1376,"stem":1377},"前端调用","/document/graphql/guide/client","document/39.graphql/01.guide/06.client",{"title":1379,"icon":1380,"path":1381,"stem":1382,"children":1383,"page":50},"Vue2 源码","i-simple-icons-vuedotjs","/document/source-vue2","document/40.source-vue2",[1384],{"title":1385,"path":1386,"stem":1387,"children":1388},"Vue2 源码简介","/document/source-vue2/guide","document/40.source-vue2/01.guide/01.index",[1389,1390,1394,1398,1402,1406,1410,1414],{"title":1385,"path":1386,"stem":1387},{"title":1391,"path":1392,"stem":1393},"初始化流程","/document/source-vue2/guide/init","document/40.source-vue2/01.guide/02.init",{"title":1395,"path":1396,"stem":1397},"响应式原理","/document/source-vue2/guide/reactive","document/40.source-vue2/01.guide/03.reactive",{"title":1399,"path":1400,"stem":1401},"Dep 与 Watcher","/document/source-vue2/guide/dep-watcher","document/40.source-vue2/01.guide/04.dep-watcher",{"title":1403,"path":1404,"stem":1405},"异步更新与 nextTick","/document/source-vue2/guide/nexttick","document/40.source-vue2/01.guide/05.nexttick",{"title":1407,"path":1408,"stem":1409},"虚拟 DOM 与 patch","/document/source-vue2/guide/vnode-patch","document/40.source-vue2/01.guide/06.vnode-patch",{"title":1411,"path":1412,"stem":1413},"模板编译","/document/source-vue2/guide/compile","document/40.source-vue2/01.guide/07.compile",{"title":1415,"path":1416,"stem":1417},"computed 与 watch 原理","/document/source-vue2/guide/computed-watch","document/40.source-vue2/01.guide/08.computed-watch",{"title":1419,"icon":1380,"path":1420,"stem":1421,"children":1422,"page":50},"Vue3 源码","/document/source-vue3","document/41.source-vue3",[1423],{"title":1424,"path":1425,"stem":1426,"children":1427},"Vue3 源码简介","/document/source-vue3/guide","document/41.source-vue3/01.guide/01.index",[1428,1429,1433,1437,1441,1445,1449,1452],{"title":1424,"path":1425,"stem":1426},{"title":1430,"path":1431,"stem":1432},"创建与挂载","/document/source-vue3/guide/create-app","document/41.source-vue3/01.guide/02.create-app",{"title":1434,"path":1435,"stem":1436},"Proxy 响应式","/document/source-vue3/guide/reactive","document/41.source-vue3/01.guide/03.reactive",{"title":1438,"path":1439,"stem":1440},"effect 与依赖收集","/document/source-vue3/guide/effect","document/41.source-vue3/01.guide/04.effect",{"title":1442,"path":1443,"stem":1444},"ref 与 computed","/document/source-vue3/guide/ref-computed","document/41.source-vue3/01.guide/05.ref-computed",{"title":1446,"path":1447,"stem":1448},"调度器与 nextTick","/document/source-vue3/guide/scheduler-nexttick","document/41.source-vue3/01.guide/06.scheduler-nexttick",{"title":1407,"path":1450,"stem":1451},"/document/source-vue3/guide/vnode-patch","document/41.source-vue3/01.guide/07.vnode-patch",{"title":1411,"path":1453,"stem":1454},"/document/source-vue3/guide/compile","document/41.source-vue3/01.guide/08.compile",{"title":1456,"icon":1457,"path":1458,"stem":1459,"children":1460,"page":50},"性能优化","i-lucide-zap","/document/performance","document/42.performance",[1461],{"title":1462,"path":1463,"stem":1464,"children":1465},"性能优化简介","/document/performance/guide","document/42.performance/01.guide/01.index",[1466,1467,1471,1475,1479,1483],{"title":1462,"path":1463,"stem":1464},{"title":1468,"path":1469,"stem":1470},"加载优化","/document/performance/guide/loading","document/42.performance/01.guide/02.loading",{"title":1472,"path":1473,"stem":1474},"渲染优化","/document/performance/guide/rendering","document/42.performance/01.guide/03.rendering",{"title":1476,"path":1477,"stem":1478},"缓存策略","/document/performance/guide/cache","document/42.performance/01.guide/04.cache",{"title":1480,"path":1481,"stem":1482},"构建产物优化","/document/performance/guide/build","document/42.performance/01.guide/05.build",{"title":1484,"path":1485,"stem":1486},"性能指标与工具","/document/performance/guide/metrics","document/42.performance/01.guide/06.metrics",{"title":1488,"icon":1489,"path":1490,"stem":1491,"children":1492,"page":50},"前端监控","i-lucide-activity","/document/monitor","document/43.monitor",[1493],{"title":1494,"path":1495,"stem":1496,"children":1497},"前端监控简介","/document/monitor/guide","document/43.monitor/01.guide/01.index",[1498,1499,1503,1507,1511,1515],{"title":1494,"path":1495,"stem":1496},{"title":1500,"path":1501,"stem":1502},"错误采集","/document/monitor/guide/error","document/43.monitor/01.guide/02.error",{"title":1504,"path":1505,"stem":1506},"埋点与上报","/document/monitor/guide/tracking","document/43.monitor/01.guide/03.tracking",{"title":1508,"path":1509,"stem":1510},"性能数据上报","/document/monitor/guide/performance-data","document/43.monitor/01.guide/04.performance-data",{"title":1512,"path":1513,"stem":1514},"Sentry 实践","/document/monitor/guide/sentry","document/43.monitor/01.guide/05.sentry",{"title":1516,"path":1517,"stem":1518},"日志与告警","/document/monitor/guide/logging","document/43.monitor/01.guide/06.logging",{"id":1520,"title":1521,"body":1522,"description":4457,"extension":4458,"links":4459,"meta":4460,"navigation":4461,"path":1289,"seo":4462,"stem":1290,"__hash__":4463},"docs/document/37.mysql/01.guide/03.query.md","条件查询、排序与分页",{"type":1523,"value":1524,"toc":4443},"minimal",[1525,1530,1551,1554,1558,1565,1618,1631,1689,1708,1882,1884,1888,1909,1936,1981,1987,2065,2076,2081,2135,2140,2230,2241,2258,2260,2264,2282,2311,2316,2358,2365,2370,2460,2472,2487,2490,2544,2551,2553,2557,2560,2568,2583,2585,2651,2654,2665,2680,2682,2796,2802,2814,2857,2860,2890,2905,2915,2926,2955,2960,2990,2995,3109,3123,3125,3129,3144,3173,3178,3304,3310,3315,3441,3444,3459,3461,3587,3590,3592,3596,3604,3619,3621,3675,3682,3716,3722,3776,3782,3836,3846,3848,3852,3859,3888,3893,3908,3913,3945,3951,3963,3970,3990,3992,4029,4040,4042,4046,4062,4068,4091,4093,4117,4127,4135,4161,4163,4187,4199,4201,4205,4291,4293,4297,4305,4316,4325,4331,4341,4351,4356,4368,4378,4393,4395,4399,4405,4411,4421,4426,4434,4436,4439],[1526,1527,1529],"h2",{"id":1528},"引言","🎯 引言",[1531,1532,1533,1534,1538,1539,1542,1543,1546,1547,1550],"p",{},"上一篇我们学会了建库建表和增删改查的基本操作，但每次查询都是「把整张表拿出来」，真实项目里很少这样干。学完这篇文章，你能用 ",[1535,1536,1537],"code",{},"WHERE"," 精确筛选数据、用 ",[1535,1540,1541],{},"ORDER BY"," 排序、用 ",[1535,1544,1545],{},"LIMIT"," 做分页，还能用聚合函数和 ",[1535,1548,1549],{},"GROUP BY"," 做统计，从表里拿出任何你想要的那部分数据。",[1552,1553],"hr",{},[1526,1555,1557],{"id":1556},"准备示例数据","🛠 准备示例数据",[1531,1559,1560,1561,1564],{},"我们沿用 ",[1535,1562,1563],{},"user"," 用户表，先建表并插入一批不同城市、不同年龄的数据，后面的查询都基于这批数据演示。",[1566,1567,1572],"pre",{"className":1568,"code":1569,"language":1570,"meta":1571,"style":1571},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","CREATE TABLE user (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    username VARCHAR(50),\n    age INT,\n    city VARCHAR(50),\n    created_at DATETIME\n);\n","sql","",[1535,1573,1574,1582,1588,1594,1600,1606,1612],{"__ignoreMap":1571},[1575,1576,1579],"span",{"class":1577,"line":1578},"line",1,[1575,1580,1581],{},"CREATE TABLE user (\n",[1575,1583,1585],{"class":1577,"line":1584},2,[1575,1586,1587],{},"    id INT PRIMARY KEY AUTO_INCREMENT,\n",[1575,1589,1591],{"class":1577,"line":1590},3,[1575,1592,1593],{},"    username VARCHAR(50),\n",[1575,1595,1597],{"class":1577,"line":1596},4,[1575,1598,1599],{},"    age INT,\n",[1575,1601,1603],{"class":1577,"line":1602},5,[1575,1604,1605],{},"    city VARCHAR(50),\n",[1575,1607,1609],{"class":1577,"line":1608},6,[1575,1610,1611],{},"    created_at DATETIME\n",[1575,1613,1615],{"class":1577,"line":1614},7,[1575,1616,1617],{},");\n",[1619,1620,1621],"tip",{},[1531,1622,1623,1624,1626,1627,1630],{},"如果执行时提示表已存在，说明上一篇已经建过 ",[1535,1625,1563],{}," 表，可以先执行 ",[1535,1628,1629],{},"DROP TABLE IF EXISTS user;"," 再重新创建，保证数据和本文一致。",[1566,1632,1634],{"className":1568,"code":1633,"language":1570,"meta":1571,"style":1571},"INSERT INTO user (username, age, city, created_at) VALUES\n    ('张三', 25, '北京', '2024-01-05 10:00:00'),\n    ('李四', 30, '上海', '2024-01-12 09:30:00'),\n    ('王五', 22, '北京', '2024-02-03 14:20:00'),\n    ('赵六', 28, '广州', '2024-02-18 16:45:00'),\n    ('钱七', 35, '上海', '2024-03-01 08:15:00'),\n    ('孙八', 19, '北京', '2024-03-10 11:00:00'),\n    ('周九', 30, '广州', '2024-03-22 19:40:00'),\n    ('吴十', NULL, '深圳', '2024-04-02 13:25:00'),\n    ('郑一', 26, '上海', '2024-04-15 15:50:00');\n",[1535,1635,1636,1641,1646,1651,1656,1661,1666,1671,1677,1683],{"__ignoreMap":1571},[1575,1637,1638],{"class":1577,"line":1578},[1575,1639,1640],{},"INSERT INTO user (username, age, city, created_at) VALUES\n",[1575,1642,1643],{"class":1577,"line":1584},[1575,1644,1645],{},"    ('张三', 25, '北京', '2024-01-05 10:00:00'),\n",[1575,1647,1648],{"class":1577,"line":1590},[1575,1649,1650],{},"    ('李四', 30, '上海', '2024-01-12 09:30:00'),\n",[1575,1652,1653],{"class":1577,"line":1596},[1575,1654,1655],{},"    ('王五', 22, '北京', '2024-02-03 14:20:00'),\n",[1575,1657,1658],{"class":1577,"line":1602},[1575,1659,1660],{},"    ('赵六', 28, '广州', '2024-02-18 16:45:00'),\n",[1575,1662,1663],{"class":1577,"line":1608},[1575,1664,1665],{},"    ('钱七', 35, '上海', '2024-03-01 08:15:00'),\n",[1575,1667,1668],{"class":1577,"line":1614},[1575,1669,1670],{},"    ('孙八', 19, '北京', '2024-03-10 11:00:00'),\n",[1575,1672,1674],{"class":1577,"line":1673},8,[1575,1675,1676],{},"    ('周九', 30, '广州', '2024-03-22 19:40:00'),\n",[1575,1678,1680],{"class":1577,"line":1679},9,[1575,1681,1682],{},"    ('吴十', NULL, '深圳', '2024-04-02 13:25:00'),\n",[1575,1684,1686],{"class":1577,"line":1685},10,[1575,1687,1688],{},"    ('郑一', 26, '上海', '2024-04-15 15:50:00');\n",[1531,1690,1691,1692,1695,1696,1699,1700,1703,1704,1707],{},"注意「吴十」的 ",[1535,1693,1694],{},"age"," 是 ",[1535,1697,1698],{},"NULL","，这是故意的，后面讲 ",[1535,1701,1702],{},"IS NULL"," 时会用到。插入后可以用 ",[1535,1705,1706],{},"SELECT * FROM user;"," 确认数据都在。执行结果如下：",[1709,1710,1711,1732],"table",{},[1712,1713,1714],"thead",{},[1715,1716,1717,1721,1724,1726,1729],"tr",{},[1718,1719,1720],"th",{},"id",[1718,1722,1723],{},"username",[1718,1725,1694],{},[1718,1727,1728],{},"city",[1718,1730,1731],{},"created_at",[1733,1734,1735,1753,1770,1786,1803,1819,1835,1850,1866],"tbody",{},[1715,1736,1737,1741,1744,1747,1750],{},[1738,1739,1740],"td",{},"1",[1738,1742,1743],{},"张三",[1738,1745,1746],{},"25",[1738,1748,1749],{},"北京",[1738,1751,1752],{},"2024-01-05 10:00:00",[1715,1754,1755,1758,1761,1764,1767],{},[1738,1756,1757],{},"2",[1738,1759,1760],{},"李四",[1738,1762,1763],{},"30",[1738,1765,1766],{},"上海",[1738,1768,1769],{},"2024-01-12 09:30:00",[1715,1771,1772,1775,1778,1781,1783],{},[1738,1773,1774],{},"3",[1738,1776,1777],{},"王五",[1738,1779,1780],{},"22",[1738,1782,1749],{},[1738,1784,1785],{},"2024-02-03 14:20:00",[1715,1787,1788,1791,1794,1797,1800],{},[1738,1789,1790],{},"4",[1738,1792,1793],{},"赵六",[1738,1795,1796],{},"28",[1738,1798,1799],{},"广州",[1738,1801,1802],{},"2024-02-18 16:45:00",[1715,1804,1805,1808,1811,1814,1816],{},[1738,1806,1807],{},"5",[1738,1809,1810],{},"钱七",[1738,1812,1813],{},"35",[1738,1815,1766],{},[1738,1817,1818],{},"2024-03-01 08:15:00",[1715,1820,1821,1824,1827,1830,1832],{},[1738,1822,1823],{},"6",[1738,1825,1826],{},"孙八",[1738,1828,1829],{},"19",[1738,1831,1749],{},[1738,1833,1834],{},"2024-03-10 11:00:00",[1715,1836,1837,1840,1843,1845,1847],{},[1738,1838,1839],{},"7",[1738,1841,1842],{},"周九",[1738,1844,1763],{},[1738,1846,1799],{},[1738,1848,1849],{},"2024-03-22 19:40:00",[1715,1851,1852,1855,1858,1860,1863],{},[1738,1853,1854],{},"8",[1738,1856,1857],{},"吴十",[1738,1859,1698],{},[1738,1861,1862],{},"深圳",[1738,1864,1865],{},"2024-04-02 13:25:00",[1715,1867,1868,1871,1874,1877,1879],{},[1738,1869,1870],{},"9",[1738,1872,1873],{},"郑一",[1738,1875,1876],{},"26",[1738,1878,1766],{},[1738,1880,1881],{},"2024-04-15 15:50:00",[1552,1883],{},[1526,1885,1887],{"id":1886},"where-条件查询","🧱 WHERE 条件查询",[1531,1889,1890,1896,1897,1900,1901,1904,1905,1908],{},[1891,1892,1893,1895],"strong",{},[1535,1894,1537],{}," 的作用是筛选行","：只返回满足条件的记录，不满足的直接丢掉。可以把它类比成前端数组的 ",[1535,1898,1899],{},"filter"," 方法，",[1535,1902,1903],{},"users.filter(u => u.age > 25)"," 和 SQL 的 ",[1535,1906,1907],{},"WHERE age > 25"," 是同一个思路。",[1531,1910,1911,1912,1915,1916,1919,1920,1923,1924,1927,1928,1931,1932,1935],{},"常用的比较运算符有 ",[1535,1913,1914],{},"=","（等于）、",[1535,1917,1918],{},">","（大于）、",[1535,1921,1922],{},"\u003C","（小于）、",[1535,1925,1926],{},"!=","（不等于），还有 ",[1535,1929,1930],{},">=","、",[1535,1933,1934],{},"\u003C=","。",[1566,1937,1939],{"className":1568,"code":1938,"language":1570,"meta":1571,"style":1571},"-- 查出年龄大于 25 的用户\nSELECT * FROM user WHERE age > 25;\n\n-- 查出城市是「北京」的用户\nSELECT * FROM user WHERE city = '北京';\n\n-- 查出年龄不等于 30 的用户\nSELECT * FROM user WHERE age != 30;\n",[1535,1940,1941,1946,1951,1957,1962,1967,1971,1976],{"__ignoreMap":1571},[1575,1942,1943],{"class":1577,"line":1578},[1575,1944,1945],{},"-- 查出年龄大于 25 的用户\n",[1575,1947,1948],{"class":1577,"line":1584},[1575,1949,1950],{},"SELECT * FROM user WHERE age > 25;\n",[1575,1952,1953],{"class":1577,"line":1590},[1575,1954,1956],{"emptyLinePlaceholder":1955},true,"\n",[1575,1958,1959],{"class":1577,"line":1596},[1575,1960,1961],{},"-- 查出城市是「北京」的用户\n",[1575,1963,1964],{"class":1577,"line":1602},[1575,1965,1966],{},"SELECT * FROM user WHERE city = '北京';\n",[1575,1968,1969],{"class":1577,"line":1608},[1575,1970,1956],{"emptyLinePlaceholder":1955},[1575,1972,1973],{"class":1577,"line":1614},[1575,1974,1975],{},"-- 查出年龄不等于 30 的用户\n",[1575,1977,1978],{"class":1577,"line":1673},[1575,1979,1980],{},"SELECT * FROM user WHERE age != 30;\n",[1531,1982,1983,1986],{},[1535,1984,1985],{},"SELECT * FROM user WHERE age > 25;"," 的执行结果如下：",[1709,1988,1989,2003],{},[1712,1990,1991],{},[1715,1992,1993,1995,1997,1999,2001],{},[1718,1994,1720],{},[1718,1996,1723],{},[1718,1998,1694],{},[1718,2000,1728],{},[1718,2002,1731],{},[1733,2004,2005,2017,2029,2041,2053],{},[1715,2006,2007,2009,2011,2013,2015],{},[1738,2008,1757],{},[1738,2010,1760],{},[1738,2012,1763],{},[1738,2014,1766],{},[1738,2016,1769],{},[1715,2018,2019,2021,2023,2025,2027],{},[1738,2020,1790],{},[1738,2022,1793],{},[1738,2024,1796],{},[1738,2026,1799],{},[1738,2028,1802],{},[1715,2030,2031,2033,2035,2037,2039],{},[1738,2032,1807],{},[1738,2034,1810],{},[1738,2036,1813],{},[1738,2038,1766],{},[1738,2040,1818],{},[1715,2042,2043,2045,2047,2049,2051],{},[1738,2044,1839],{},[1738,2046,1842],{},[1738,2048,1763],{},[1738,2050,1799],{},[1738,2052,1849],{},[1715,2054,2055,2057,2059,2061,2063],{},[1738,2056,1870],{},[1738,2058,1873],{},[1738,2060,1876],{},[1738,2062,1766],{},[1738,2064,1881],{},[1531,2066,2067,2068,1695,2070,2072,2073,2075],{},"注意吴十的 ",[1535,2069,1694],{},[1535,2071,1698],{},"，",[1535,2074,1698],{}," 和 25 比较结果不为真，所以它不会出现在结果里。",[1531,2077,2078,1986],{},[1535,2079,2080],{},"SELECT * FROM user WHERE city = '北京';",[1709,2082,2083,2097],{},[1712,2084,2085],{},[1715,2086,2087,2089,2091,2093,2095],{},[1718,2088,1720],{},[1718,2090,1723],{},[1718,2092,1694],{},[1718,2094,1728],{},[1718,2096,1731],{},[1733,2098,2099,2111,2123],{},[1715,2100,2101,2103,2105,2107,2109],{},[1738,2102,1740],{},[1738,2104,1743],{},[1738,2106,1746],{},[1738,2108,1749],{},[1738,2110,1752],{},[1715,2112,2113,2115,2117,2119,2121],{},[1738,2114,1774],{},[1738,2116,1777],{},[1738,2118,1780],{},[1738,2120,1749],{},[1738,2122,1785],{},[1715,2124,2125,2127,2129,2131,2133],{},[1738,2126,1823],{},[1738,2128,1826],{},[1738,2130,1829],{},[1738,2132,1749],{},[1738,2134,1834],{},[1531,2136,2137,1986],{},[1535,2138,2139],{},"SELECT * FROM user WHERE age != 30;",[1709,2141,2142,2156],{},[1712,2143,2144],{},[1715,2145,2146,2148,2150,2152,2154],{},[1718,2147,1720],{},[1718,2149,1723],{},[1718,2151,1694],{},[1718,2153,1728],{},[1718,2155,1731],{},[1733,2157,2158,2170,2182,2194,2206,2218],{},[1715,2159,2160,2162,2164,2166,2168],{},[1738,2161,1740],{},[1738,2163,1743],{},[1738,2165,1746],{},[1738,2167,1749],{},[1738,2169,1752],{},[1715,2171,2172,2174,2176,2178,2180],{},[1738,2173,1774],{},[1738,2175,1777],{},[1738,2177,1780],{},[1738,2179,1749],{},[1738,2181,1785],{},[1715,2183,2184,2186,2188,2190,2192],{},[1738,2185,1790],{},[1738,2187,1793],{},[1738,2189,1796],{},[1738,2191,1799],{},[1738,2193,1802],{},[1715,2195,2196,2198,2200,2202,2204],{},[1738,2197,1807],{},[1738,2199,1810],{},[1738,2201,1813],{},[1738,2203,1766],{},[1738,2205,1818],{},[1715,2207,2208,2210,2212,2214,2216],{},[1738,2209,1823],{},[1738,2211,1826],{},[1738,2213,1829],{},[1738,2215,1749],{},[1738,2217,1834],{},[1715,2219,2220,2222,2224,2226,2228],{},[1738,2221,1870],{},[1738,2223,1873],{},[1738,2225,1876],{},[1738,2227,1766],{},[1738,2229,1881],{},[1531,2231,2232,2233,1695,2235,2072,2237,2240],{},"吴十的 ",[1535,2234,1694],{},[1535,2236,1698],{},[1535,2238,2239],{},"NULL != 30"," 同样不成立，所以它也被排除了。",[2242,2243,2244],"warning",{},[1531,2245,2246,2247,2249,2250,2253,2254,2257],{},"SQL 里判断相等用一个等号 ",[1535,2248,1914],{},"，不是 ",[1535,2251,2252],{},"=="," 也不是 ",[1535,2255,2256],{},"===","。字符串要用引号包起来，数字不用。",[1552,2259],{},[1526,2261,2263],{"id":2262},"and-or-组合条件","✨ AND / OR 组合条件",[1531,2265,2266,2267,2270,2271,2274,2275,1931,2278,2281],{},"一个条件不够用时，可以用 ",[1535,2268,2269],{},"AND","（并且）和 ",[1535,2272,2273],{},"OR","（或者）把多个条件组合起来，逻辑和 JS 里的 ",[1535,2276,2277],{},"&&",[1535,2279,2280],{},"||"," 一样。",[1566,2283,2285],{"className":1568,"code":2284,"language":1570,"meta":1571,"style":1571},"-- 北京且年龄大于 20 的用户\nSELECT * FROM user WHERE city = '北京' AND age > 20;\n\n-- 北京或上海的用户\nSELECT * FROM user WHERE city = '北京' OR city = '上海';\n",[1535,2286,2287,2292,2297,2301,2306],{"__ignoreMap":1571},[1575,2288,2289],{"class":1577,"line":1578},[1575,2290,2291],{},"-- 北京且年龄大于 20 的用户\n",[1575,2293,2294],{"class":1577,"line":1584},[1575,2295,2296],{},"SELECT * FROM user WHERE city = '北京' AND age > 20;\n",[1575,2298,2299],{"class":1577,"line":1590},[1575,2300,1956],{"emptyLinePlaceholder":1955},[1575,2302,2303],{"class":1577,"line":1596},[1575,2304,2305],{},"-- 北京或上海的用户\n",[1575,2307,2308],{"class":1577,"line":1602},[1575,2309,2310],{},"SELECT * FROM user WHERE city = '北京' OR city = '上海';\n",[1531,2312,2313,1986],{},[1535,2314,2315],{},"SELECT * FROM user WHERE city = '北京' AND age > 20;",[1709,2317,2318,2332],{},[1712,2319,2320],{},[1715,2321,2322,2324,2326,2328,2330],{},[1718,2323,1720],{},[1718,2325,1723],{},[1718,2327,1694],{},[1718,2329,1728],{},[1718,2331,1731],{},[1733,2333,2334,2346],{},[1715,2335,2336,2338,2340,2342,2344],{},[1738,2337,1740],{},[1738,2339,1743],{},[1738,2341,1746],{},[1738,2343,1749],{},[1738,2345,1752],{},[1715,2347,2348,2350,2352,2354,2356],{},[1738,2349,1774],{},[1738,2351,1777],{},[1738,2353,1780],{},[1738,2355,1749],{},[1738,2357,1785],{},[1531,2359,2360,2361,2364],{},"孙八也是北京的，但年龄 19 不满足 ",[1535,2362,2363],{},"age > 20","，被筛掉了。",[1531,2366,2367,1986],{},[1535,2368,2369],{},"SELECT * FROM user WHERE city = '北京' OR city = '上海';",[1709,2371,2372,2386],{},[1712,2373,2374],{},[1715,2375,2376,2378,2380,2382,2384],{},[1718,2377,1720],{},[1718,2379,1723],{},[1718,2381,1694],{},[1718,2383,1728],{},[1718,2385,1731],{},[1733,2387,2388,2400,2412,2424,2436,2448],{},[1715,2389,2390,2392,2394,2396,2398],{},[1738,2391,1740],{},[1738,2393,1743],{},[1738,2395,1746],{},[1738,2397,1749],{},[1738,2399,1752],{},[1715,2401,2402,2404,2406,2408,2410],{},[1738,2403,1757],{},[1738,2405,1760],{},[1738,2407,1763],{},[1738,2409,1766],{},[1738,2411,1769],{},[1715,2413,2414,2416,2418,2420,2422],{},[1738,2415,1774],{},[1738,2417,1777],{},[1738,2419,1780],{},[1738,2421,1749],{},[1738,2423,1785],{},[1715,2425,2426,2428,2430,2432,2434],{},[1738,2427,1807],{},[1738,2429,1810],{},[1738,2431,1813],{},[1738,2433,1766],{},[1738,2435,1818],{},[1715,2437,2438,2440,2442,2444,2446],{},[1738,2439,1823],{},[1738,2441,1826],{},[1738,2443,1829],{},[1738,2445,1749],{},[1738,2447,1834],{},[1715,2449,2450,2452,2454,2456,2458],{},[1738,2451,1870],{},[1738,2453,1873],{},[1738,2455,1876],{},[1738,2457,1766],{},[1738,2459,1881],{},[1531,2461,2462,2463,2465,2466,2468,2469,2471],{},"当 ",[1535,2464,2269],{}," 和 ",[1535,2467,2273],{}," 同时出现时，",[1535,2470,2269],{}," 的优先级更高，容易写出和预期不符的条件。建议养成加括号的习惯：",[1566,2473,2475],{"className":1568,"code":2474,"language":1570,"meta":1571,"style":1571},"-- 年龄大于 30，或者（北京且年龄大于 20）\nSELECT * FROM user WHERE age > 30 OR (city = '北京' AND age > 20);\n",[1535,2476,2477,2482],{"__ignoreMap":1571},[1575,2478,2479],{"class":1577,"line":1578},[1575,2480,2481],{},"-- 年龄大于 30，或者（北京且年龄大于 20）\n",[1575,2483,2484],{"class":1577,"line":1584},[1575,2485,2486],{},"SELECT * FROM user WHERE age > 30 OR (city = '北京' AND age > 20);\n",[1531,2488,2489],{},"执行结果如下：",[1709,2491,2492,2506],{},[1712,2493,2494],{},[1715,2495,2496,2498,2500,2502,2504],{},[1718,2497,1720],{},[1718,2499,1723],{},[1718,2501,1694],{},[1718,2503,1728],{},[1718,2505,1731],{},[1733,2507,2508,2520,2532],{},[1715,2509,2510,2512,2514,2516,2518],{},[1738,2511,1740],{},[1738,2513,1743],{},[1738,2515,1746],{},[1738,2517,1749],{},[1738,2519,1752],{},[1715,2521,2522,2524,2526,2528,2530],{},[1738,2523,1774],{},[1738,2525,1777],{},[1738,2527,1780],{},[1738,2529,1749],{},[1738,2531,1785],{},[1715,2533,2534,2536,2538,2540,2542],{},[1738,2535,1807],{},[1738,2537,1810],{},[1738,2539,1813],{},[1738,2541,1766],{},[1738,2543,1818],{},[1531,2545,2546,2547,2550],{},"钱七因为年龄 35 满足 ",[1535,2548,2549],{},"age > 30"," 入选，张三和王五因为满足括号里「北京且年龄大于 20」入选。",[1552,2552],{},[1526,2554,2556],{"id":2555},"betweeninlikeis-null","💡 BETWEEN、IN、LIKE、IS NULL",[1531,2558,2559],{},"除了比较运算符，还有四个常用的条件写法，各自解决一类场景。",[1531,2561,2562,2567],{},[1891,2563,2564],{},[1535,2565,2566],{},"BETWEEN ... AND ..."," 表示闭区间，包含两端，适合查范围：",[1566,2569,2571],{"className":1568,"code":2570,"language":1570,"meta":1571,"style":1571},"-- 年龄在 22 到 28 之间的用户（含 22 和 28）\nSELECT * FROM user WHERE age BETWEEN 22 AND 28;\n",[1535,2572,2573,2578],{"__ignoreMap":1571},[1575,2574,2575],{"class":1577,"line":1578},[1575,2576,2577],{},"-- 年龄在 22 到 28 之间的用户（含 22 和 28）\n",[1575,2579,2580],{"class":1577,"line":1584},[1575,2581,2582],{},"SELECT * FROM user WHERE age BETWEEN 22 AND 28;\n",[1531,2584,2489],{},[1709,2586,2587,2601],{},[1712,2588,2589],{},[1715,2590,2591,2593,2595,2597,2599],{},[1718,2592,1720],{},[1718,2594,1723],{},[1718,2596,1694],{},[1718,2598,1728],{},[1718,2600,1731],{},[1733,2602,2603,2615,2627,2639],{},[1715,2604,2605,2607,2609,2611,2613],{},[1738,2606,1740],{},[1738,2608,1743],{},[1738,2610,1746],{},[1738,2612,1749],{},[1738,2614,1752],{},[1715,2616,2617,2619,2621,2623,2625],{},[1738,2618,1774],{},[1738,2620,1777],{},[1738,2622,1780],{},[1738,2624,1749],{},[1738,2626,1785],{},[1715,2628,2629,2631,2633,2635,2637],{},[1738,2630,1790],{},[1738,2632,1793],{},[1738,2634,1796],{},[1738,2636,1799],{},[1738,2638,1802],{},[1715,2640,2641,2643,2645,2647,2649],{},[1738,2642,1870],{},[1738,2644,1873],{},[1738,2646,1876],{},[1738,2648,1766],{},[1738,2650,1881],{},[1531,2652,2653],{},"王五 22 岁和赵六 28 岁正好卡在两端，因为是闭区间所以都包含在内。",[1531,2655,2656,2661,2662,2664],{},[1891,2657,2658],{},[1535,2659,2660],{},"IN"," 表示「在几个值之中」，比写一长串 ",[1535,2663,2273],{}," 清爽：",[1566,2666,2668],{"className":1568,"code":2667,"language":1570,"meta":1571,"style":1571},"-- 北京、上海、广州的用户\nSELECT * FROM user WHERE city IN ('北京', '上海', '广州');\n",[1535,2669,2670,2675],{"__ignoreMap":1571},[1575,2671,2672],{"class":1577,"line":1578},[1575,2673,2674],{},"-- 北京、上海、广州的用户\n",[1575,2676,2677],{"class":1577,"line":1584},[1575,2678,2679],{},"SELECT * FROM user WHERE city IN ('北京', '上海', '广州');\n",[1531,2681,2489],{},[1709,2683,2684,2698],{},[1712,2685,2686],{},[1715,2687,2688,2690,2692,2694,2696],{},[1718,2689,1720],{},[1718,2691,1723],{},[1718,2693,1694],{},[1718,2695,1728],{},[1718,2697,1731],{},[1733,2699,2700,2712,2724,2736,2748,2760,2772,2784],{},[1715,2701,2702,2704,2706,2708,2710],{},[1738,2703,1740],{},[1738,2705,1743],{},[1738,2707,1746],{},[1738,2709,1749],{},[1738,2711,1752],{},[1715,2713,2714,2716,2718,2720,2722],{},[1738,2715,1757],{},[1738,2717,1760],{},[1738,2719,1763],{},[1738,2721,1766],{},[1738,2723,1769],{},[1715,2725,2726,2728,2730,2732,2734],{},[1738,2727,1774],{},[1738,2729,1777],{},[1738,2731,1780],{},[1738,2733,1749],{},[1738,2735,1785],{},[1715,2737,2738,2740,2742,2744,2746],{},[1738,2739,1790],{},[1738,2741,1793],{},[1738,2743,1796],{},[1738,2745,1799],{},[1738,2747,1802],{},[1715,2749,2750,2752,2754,2756,2758],{},[1738,2751,1807],{},[1738,2753,1810],{},[1738,2755,1813],{},[1738,2757,1766],{},[1738,2759,1818],{},[1715,2761,2762,2764,2766,2768,2770],{},[1738,2763,1823],{},[1738,2765,1826],{},[1738,2767,1829],{},[1738,2769,1749],{},[1738,2771,1834],{},[1715,2773,2774,2776,2778,2780,2782],{},[1738,2775,1839],{},[1738,2777,1842],{},[1738,2779,1763],{},[1738,2781,1799],{},[1738,2783,1849],{},[1715,2785,2786,2788,2790,2792,2794],{},[1738,2787,1870],{},[1738,2789,1873],{},[1738,2791,1876],{},[1738,2793,1766],{},[1738,2795,1881],{},[1531,2797,2798,2799,2801],{},"只有深圳的吴十不在 ",[1535,2800,2660],{}," 列表里，被筛掉了。",[1531,2803,2804,2809,2810,2813],{},[1891,2805,2806],{},[1535,2807,2808],{},"LIKE"," 是模糊查询，配合通配符 ",[1535,2811,2812],{},"%","（匹配任意多个字符）使用：",[1566,2815,2817],{"className":1568,"code":2816,"language":1570,"meta":1571,"style":1571},"-- 用户名以「张」开头\nSELECT * FROM user WHERE username LIKE '张%';\n\n-- 用户名以「三」结尾\nSELECT * FROM user WHERE username LIKE '%三';\n\n-- 用户名中包含「三」\nSELECT * FROM user WHERE username LIKE '%三%';\n",[1535,2818,2819,2824,2829,2833,2838,2843,2847,2852],{"__ignoreMap":1571},[1575,2820,2821],{"class":1577,"line":1578},[1575,2822,2823],{},"-- 用户名以「张」开头\n",[1575,2825,2826],{"class":1577,"line":1584},[1575,2827,2828],{},"SELECT * FROM user WHERE username LIKE '张%';\n",[1575,2830,2831],{"class":1577,"line":1590},[1575,2832,1956],{"emptyLinePlaceholder":1955},[1575,2834,2835],{"class":1577,"line":1596},[1575,2836,2837],{},"-- 用户名以「三」结尾\n",[1575,2839,2840],{"class":1577,"line":1602},[1575,2841,2842],{},"SELECT * FROM user WHERE username LIKE '%三';\n",[1575,2844,2845],{"class":1577,"line":1608},[1575,2846,1956],{"emptyLinePlaceholder":1955},[1575,2848,2849],{"class":1577,"line":1614},[1575,2850,2851],{},"-- 用户名中包含「三」\n",[1575,2853,2854],{"class":1577,"line":1673},[1575,2855,2856],{},"SELECT * FROM user WHERE username LIKE '%三%';\n",[1531,2858,2859],{},"这三条语句在这批数据里的执行结果相同，都只匹配到张三：",[1709,2861,2862,2876],{},[1712,2863,2864],{},[1715,2865,2866,2868,2870,2872,2874],{},[1718,2867,1720],{},[1718,2869,1723],{},[1718,2871,1694],{},[1718,2873,1728],{},[1718,2875,1731],{},[1733,2877,2878],{},[1715,2879,2880,2882,2884,2886,2888],{},[1738,2881,1740],{},[1738,2883,1743],{},[1738,2885,1746],{},[1738,2887,1749],{},[1738,2889,1752],{},[1531,2891,2892,2893,2896,2897,2900,2901,2904],{},"如果表里有「小张」「张三丰」之类的数据，三条语句的结果就不一样了：",[1535,2894,2895],{},"LIKE '张%'"," 能匹配「张三丰」但匹配不到「小张」，",[1535,2898,2899],{},"LIKE '%三'"," 能匹配「张三丰」但匹配不到「三月」，",[1535,2902,2903],{},"LIKE '%三%'"," 则两边都能匹配。",[1619,2906,2907],{},[1531,2908,2909,2911,2912,2914],{},[1535,2910,2812],{}," 放前面、放后面、两边都放，匹配效果不同，上面的三条语句可以分别执行对比结果。至于 ",[1535,2913,2812],{}," 放前面对查询性能的影响，我们在第 07 篇讲索引时再展开。",[1531,2916,2917,2921,2922,2925],{},[1891,2918,2919],{},[1535,2920,1702],{}," 用来查空值。空值在数据库里是「没有值」，不是 0 也不是空字符串，判断时不能用 ",[1535,2923,2924],{},"= NULL","：",[1566,2927,2929],{"className":1568,"code":2928,"language":1570,"meta":1571,"style":1571},"-- 查出年龄为空的用户（吴十）\nSELECT * FROM user WHERE age IS NULL;\n\n-- 反过来：年龄不为空的用户\nSELECT * FROM user WHERE age IS NOT NULL;\n",[1535,2930,2931,2936,2941,2945,2950],{"__ignoreMap":1571},[1575,2932,2933],{"class":1577,"line":1578},[1575,2934,2935],{},"-- 查出年龄为空的用户（吴十）\n",[1575,2937,2938],{"class":1577,"line":1584},[1575,2939,2940],{},"SELECT * FROM user WHERE age IS NULL;\n",[1575,2942,2943],{"class":1577,"line":1590},[1575,2944,1956],{"emptyLinePlaceholder":1955},[1575,2946,2947],{"class":1577,"line":1596},[1575,2948,2949],{},"-- 反过来：年龄不为空的用户\n",[1575,2951,2952],{"class":1577,"line":1602},[1575,2953,2954],{},"SELECT * FROM user WHERE age IS NOT NULL;\n",[1531,2956,2957,1986],{},[1535,2958,2959],{},"SELECT * FROM user WHERE age IS NULL;",[1709,2961,2962,2976],{},[1712,2963,2964],{},[1715,2965,2966,2968,2970,2972,2974],{},[1718,2967,1720],{},[1718,2969,1723],{},[1718,2971,1694],{},[1718,2973,1728],{},[1718,2975,1731],{},[1733,2977,2978],{},[1715,2979,2980,2982,2984,2986,2988],{},[1738,2981,1854],{},[1738,2983,1857],{},[1738,2985,1698],{},[1738,2987,1862],{},[1738,2989,1865],{},[1531,2991,2992,1986],{},[1535,2993,2994],{},"SELECT * FROM user WHERE age IS NOT NULL;",[1709,2996,2997,3011],{},[1712,2998,2999],{},[1715,3000,3001,3003,3005,3007,3009],{},[1718,3002,1720],{},[1718,3004,1723],{},[1718,3006,1694],{},[1718,3008,1728],{},[1718,3010,1731],{},[1733,3012,3013,3025,3037,3049,3061,3073,3085,3097],{},[1715,3014,3015,3017,3019,3021,3023],{},[1738,3016,1740],{},[1738,3018,1743],{},[1738,3020,1746],{},[1738,3022,1749],{},[1738,3024,1752],{},[1715,3026,3027,3029,3031,3033,3035],{},[1738,3028,1757],{},[1738,3030,1760],{},[1738,3032,1763],{},[1738,3034,1766],{},[1738,3036,1769],{},[1715,3038,3039,3041,3043,3045,3047],{},[1738,3040,1774],{},[1738,3042,1777],{},[1738,3044,1780],{},[1738,3046,1749],{},[1738,3048,1785],{},[1715,3050,3051,3053,3055,3057,3059],{},[1738,3052,1790],{},[1738,3054,1793],{},[1738,3056,1796],{},[1738,3058,1799],{},[1738,3060,1802],{},[1715,3062,3063,3065,3067,3069,3071],{},[1738,3064,1807],{},[1738,3066,1810],{},[1738,3068,1813],{},[1738,3070,1766],{},[1738,3072,1818],{},[1715,3074,3075,3077,3079,3081,3083],{},[1738,3076,1823],{},[1738,3078,1826],{},[1738,3080,1829],{},[1738,3082,1749],{},[1738,3084,1834],{},[1715,3086,3087,3089,3091,3093,3095],{},[1738,3088,1839],{},[1738,3090,1842],{},[1738,3092,1763],{},[1738,3094,1799],{},[1738,3096,1849],{},[1715,3098,3099,3101,3103,3105,3107],{},[1738,3100,1870],{},[1738,3102,1873],{},[1738,3104,1876],{},[1738,3106,1766],{},[1738,3108,1881],{},[2242,3110,3111],{},[1531,3112,3113,3116,3117,3119,3120,1935],{},[1535,3114,3115],{},"WHERE age = NULL"," 查不出任何数据，这是初学者经常踩的坑。判断空值必须用 ",[1535,3118,1702],{}," 或 ",[1535,3121,3122],{},"IS NOT NULL",[1552,3124],{},[1526,3126,3128],{"id":3127},"order-by-排序","🧰 ORDER BY 排序",[1531,3130,3131,3132,1935,3136,3139,3140,3143],{},"查询结果的默认顺序不保证稳定，想要有序的结果就要显式写 ",[1891,3133,3134],{},[1535,3135,1541],{},[1535,3137,3138],{},"ASC"," 表示升序（从小到大，默认值可省略），",[1535,3141,3142],{},"DESC"," 表示降序（从大到小）。",[1566,3145,3147],{"className":1568,"code":3146,"language":1570,"meta":1571,"style":1571},"-- 按年龄从小到大排序\nSELECT * FROM user ORDER BY age ASC;\n\n-- 按创建时间从新到旧排序\nSELECT * FROM user ORDER BY created_at DESC;\n",[1535,3148,3149,3154,3159,3163,3168],{"__ignoreMap":1571},[1575,3150,3151],{"class":1577,"line":1578},[1575,3152,3153],{},"-- 按年龄从小到大排序\n",[1575,3155,3156],{"class":1577,"line":1584},[1575,3157,3158],{},"SELECT * FROM user ORDER BY age ASC;\n",[1575,3160,3161],{"class":1577,"line":1590},[1575,3162,1956],{"emptyLinePlaceholder":1955},[1575,3164,3165],{"class":1577,"line":1596},[1575,3166,3167],{},"-- 按创建时间从新到旧排序\n",[1575,3169,3170],{"class":1577,"line":1602},[1575,3171,3172],{},"SELECT * FROM user ORDER BY created_at DESC;\n",[1531,3174,3175,1986],{},[1535,3176,3177],{},"SELECT * FROM user ORDER BY age ASC;",[1709,3179,3180,3194],{},[1712,3181,3182],{},[1715,3183,3184,3186,3188,3190,3192],{},[1718,3185,1720],{},[1718,3187,1723],{},[1718,3189,1694],{},[1718,3191,1728],{},[1718,3193,1731],{},[1733,3195,3196,3208,3220,3232,3244,3256,3268,3280,3292],{},[1715,3197,3198,3200,3202,3204,3206],{},[1738,3199,1854],{},[1738,3201,1857],{},[1738,3203,1698],{},[1738,3205,1862],{},[1738,3207,1865],{},[1715,3209,3210,3212,3214,3216,3218],{},[1738,3211,1823],{},[1738,3213,1826],{},[1738,3215,1829],{},[1738,3217,1749],{},[1738,3219,1834],{},[1715,3221,3222,3224,3226,3228,3230],{},[1738,3223,1774],{},[1738,3225,1777],{},[1738,3227,1780],{},[1738,3229,1749],{},[1738,3231,1785],{},[1715,3233,3234,3236,3238,3240,3242],{},[1738,3235,1740],{},[1738,3237,1743],{},[1738,3239,1746],{},[1738,3241,1749],{},[1738,3243,1752],{},[1715,3245,3246,3248,3250,3252,3254],{},[1738,3247,1870],{},[1738,3249,1873],{},[1738,3251,1876],{},[1738,3253,1766],{},[1738,3255,1881],{},[1715,3257,3258,3260,3262,3264,3266],{},[1738,3259,1790],{},[1738,3261,1793],{},[1738,3263,1796],{},[1738,3265,1799],{},[1738,3267,1802],{},[1715,3269,3270,3272,3274,3276,3278],{},[1738,3271,1757],{},[1738,3273,1760],{},[1738,3275,1763],{},[1738,3277,1766],{},[1738,3279,1769],{},[1715,3281,3282,3284,3286,3288,3290],{},[1738,3283,1839],{},[1738,3285,1842],{},[1738,3287,1763],{},[1738,3289,1799],{},[1738,3291,1849],{},[1715,3293,3294,3296,3298,3300,3302],{},[1738,3295,1807],{},[1738,3297,1810],{},[1738,3299,1813],{},[1738,3301,1766],{},[1738,3303,1818],{},[1531,3305,3306,3307,3309],{},"升序时 ",[1535,3308,1698],{}," 会排在前面，所以吴十出现在第一行。",[1531,3311,3312,1986],{},[1535,3313,3314],{},"SELECT * FROM user ORDER BY created_at DESC;",[1709,3316,3317,3331],{},[1712,3318,3319],{},[1715,3320,3321,3323,3325,3327,3329],{},[1718,3322,1720],{},[1718,3324,1723],{},[1718,3326,1694],{},[1718,3328,1728],{},[1718,3330,1731],{},[1733,3332,3333,3345,3357,3369,3381,3393,3405,3417,3429],{},[1715,3334,3335,3337,3339,3341,3343],{},[1738,3336,1870],{},[1738,3338,1873],{},[1738,3340,1876],{},[1738,3342,1766],{},[1738,3344,1881],{},[1715,3346,3347,3349,3351,3353,3355],{},[1738,3348,1854],{},[1738,3350,1857],{},[1738,3352,1698],{},[1738,3354,1862],{},[1738,3356,1865],{},[1715,3358,3359,3361,3363,3365,3367],{},[1738,3360,1839],{},[1738,3362,1842],{},[1738,3364,1763],{},[1738,3366,1799],{},[1738,3368,1849],{},[1715,3370,3371,3373,3375,3377,3379],{},[1738,3372,1823],{},[1738,3374,1826],{},[1738,3376,1829],{},[1738,3378,1749],{},[1738,3380,1834],{},[1715,3382,3383,3385,3387,3389,3391],{},[1738,3384,1807],{},[1738,3386,1810],{},[1738,3388,1813],{},[1738,3390,1766],{},[1738,3392,1818],{},[1715,3394,3395,3397,3399,3401,3403],{},[1738,3396,1790],{},[1738,3398,1793],{},[1738,3400,1796],{},[1738,3402,1799],{},[1738,3404,1802],{},[1715,3406,3407,3409,3411,3413,3415],{},[1738,3408,1774],{},[1738,3410,1777],{},[1738,3412,1780],{},[1738,3414,1749],{},[1738,3416,1785],{},[1715,3418,3419,3421,3423,3425,3427],{},[1738,3420,1757],{},[1738,3422,1760],{},[1738,3424,1763],{},[1738,3426,1766],{},[1738,3428,1769],{},[1715,3430,3431,3433,3435,3437,3439],{},[1738,3432,1740],{},[1738,3434,1743],{},[1738,3436,1746],{},[1738,3438,1749],{},[1738,3440,1752],{},[1531,3442,3443],{},"还可以按多列排序：先按第一列排，第一列相同的再按第二列排。",[1566,3445,3447],{"className":1568,"code":3446,"language":1570,"meta":1571,"style":1571},"-- 先按城市升序，同城内再按年龄降序\nSELECT * FROM user ORDER BY city ASC, age DESC;\n",[1535,3448,3449,3454],{"__ignoreMap":1571},[1575,3450,3451],{"class":1577,"line":1578},[1575,3452,3453],{},"-- 先按城市升序，同城内再按年龄降序\n",[1575,3455,3456],{"class":1577,"line":1584},[1575,3457,3458],{},"SELECT * FROM user ORDER BY city ASC, age DESC;\n",[1531,3460,2489],{},[1709,3462,3463,3477],{},[1712,3464,3465],{},[1715,3466,3467,3469,3471,3473,3475],{},[1718,3468,1720],{},[1718,3470,1723],{},[1718,3472,1694],{},[1718,3474,1728],{},[1718,3476,1731],{},[1733,3478,3479,3491,3503,3515,3527,3539,3551,3563,3575],{},[1715,3480,3481,3483,3485,3487,3489],{},[1738,3482,1807],{},[1738,3484,1810],{},[1738,3486,1813],{},[1738,3488,1766],{},[1738,3490,1818],{},[1715,3492,3493,3495,3497,3499,3501],{},[1738,3494,1757],{},[1738,3496,1760],{},[1738,3498,1763],{},[1738,3500,1766],{},[1738,3502,1769],{},[1715,3504,3505,3507,3509,3511,3513],{},[1738,3506,1870],{},[1738,3508,1873],{},[1738,3510,1876],{},[1738,3512,1766],{},[1738,3514,1881],{},[1715,3516,3517,3519,3521,3523,3525],{},[1738,3518,1740],{},[1738,3520,1743],{},[1738,3522,1746],{},[1738,3524,1749],{},[1738,3526,1752],{},[1715,3528,3529,3531,3533,3535,3537],{},[1738,3530,1774],{},[1738,3532,1777],{},[1738,3534,1780],{},[1738,3536,1749],{},[1738,3538,1785],{},[1715,3540,3541,3543,3545,3547,3549],{},[1738,3542,1823],{},[1738,3544,1826],{},[1738,3546,1829],{},[1738,3548,1749],{},[1738,3550,1834],{},[1715,3552,3553,3555,3557,3559,3561],{},[1738,3554,1839],{},[1738,3556,1842],{},[1738,3558,1763],{},[1738,3560,1799],{},[1738,3562,1849],{},[1715,3564,3565,3567,3569,3571,3573],{},[1738,3566,1790],{},[1738,3568,1793],{},[1738,3570,1796],{},[1738,3572,1799],{},[1738,3574,1802],{},[1715,3576,3577,3579,3581,3583,3585],{},[1738,3578,1854],{},[1738,3580,1857],{},[1738,3582,1698],{},[1738,3584,1862],{},[1738,3586,1865],{},[1531,3588,3589],{},"可以看到同一个城市的行聚在一起，城市内部再按年龄从大到小排，比如上海三人依次是钱七 35、李四 30、郑一 26。",[1552,3591],{},[1526,3593,3595],{"id":3594},"limit-分页","⚡ LIMIT 分页",[1531,3597,3598,3599,3603],{},"数据量大了以后，一次查出全部数据既慢又没必要，前端列表也是一页一页展示的。SQL 里用 ",[1891,3600,3601],{},[1535,3602,1545],{}," 限制返回的条数：",[1566,3605,3607],{"className":1568,"code":3606,"language":1570,"meta":1571,"style":1571},"-- 只取前 3 条\nSELECT * FROM user LIMIT 3;\n",[1535,3608,3609,3614],{"__ignoreMap":1571},[1575,3610,3611],{"class":1577,"line":1578},[1575,3612,3613],{},"-- 只取前 3 条\n",[1575,3615,3616],{"class":1577,"line":1584},[1575,3617,3618],{},"SELECT * FROM user LIMIT 3;\n",[1531,3620,2489],{},[1709,3622,3623,3637],{},[1712,3624,3625],{},[1715,3626,3627,3629,3631,3633,3635],{},[1718,3628,1720],{},[1718,3630,1723],{},[1718,3632,1694],{},[1718,3634,1728],{},[1718,3636,1731],{},[1733,3638,3639,3651,3663],{},[1715,3640,3641,3643,3645,3647,3649],{},[1738,3642,1740],{},[1738,3644,1743],{},[1738,3646,1746],{},[1738,3648,1749],{},[1738,3650,1752],{},[1715,3652,3653,3655,3657,3659,3661],{},[1738,3654,1757],{},[1738,3656,1760],{},[1738,3658,1763],{},[1738,3660,1766],{},[1738,3662,1769],{},[1715,3664,3665,3667,3669,3671,3673],{},[1738,3666,1774],{},[1738,3668,1777],{},[1738,3670,1780],{},[1738,3672,1749],{},[1738,3674,1785],{},[1531,3676,3677,3678,3681],{},"分页的写法是 ",[1535,3679,3680],{},"LIMIT offset, count","：跳过 offset 条，再取 count 条。类比前端分页「第 2 页，每页 3 条」：跳过前 3 条，取接下来的 3 条。",[1566,3683,3685],{"className":1568,"code":3684,"language":1570,"meta":1571,"style":1571},"-- 第 1 页：LIMIT 0, 3\n-- 第 2 页：跳过前 3 条，取 3 条\nSELECT * FROM user ORDER BY id ASC LIMIT 3, 3;\n\n-- 第 3 页\nSELECT * FROM user ORDER BY id ASC LIMIT 6, 3;\n",[1535,3686,3687,3692,3697,3702,3706,3711],{"__ignoreMap":1571},[1575,3688,3689],{"class":1577,"line":1578},[1575,3690,3691],{},"-- 第 1 页：LIMIT 0, 3\n",[1575,3693,3694],{"class":1577,"line":1584},[1575,3695,3696],{},"-- 第 2 页：跳过前 3 条，取 3 条\n",[1575,3698,3699],{"class":1577,"line":1590},[1575,3700,3701],{},"SELECT * FROM user ORDER BY id ASC LIMIT 3, 3;\n",[1575,3703,3704],{"class":1577,"line":1596},[1575,3705,1956],{"emptyLinePlaceholder":1955},[1575,3707,3708],{"class":1577,"line":1602},[1575,3709,3710],{},"-- 第 3 页\n",[1575,3712,3713],{"class":1577,"line":1608},[1575,3714,3715],{},"SELECT * FROM user ORDER BY id ASC LIMIT 6, 3;\n",[1531,3717,3718,3721],{},[1535,3719,3720],{},"SELECT * FROM user ORDER BY id ASC LIMIT 3, 3;"," 的执行结果如下（第 2 页）：",[1709,3723,3724,3738],{},[1712,3725,3726],{},[1715,3727,3728,3730,3732,3734,3736],{},[1718,3729,1720],{},[1718,3731,1723],{},[1718,3733,1694],{},[1718,3735,1728],{},[1718,3737,1731],{},[1733,3739,3740,3752,3764],{},[1715,3741,3742,3744,3746,3748,3750],{},[1738,3743,1790],{},[1738,3745,1793],{},[1738,3747,1796],{},[1738,3749,1799],{},[1738,3751,1802],{},[1715,3753,3754,3756,3758,3760,3762],{},[1738,3755,1807],{},[1738,3757,1810],{},[1738,3759,1813],{},[1738,3761,1766],{},[1738,3763,1818],{},[1715,3765,3766,3768,3770,3772,3774],{},[1738,3767,1823],{},[1738,3769,1826],{},[1738,3771,1829],{},[1738,3773,1749],{},[1738,3775,1834],{},[1531,3777,3778,3781],{},[1535,3779,3780],{},"SELECT * FROM user ORDER BY id ASC LIMIT 6, 3;"," 的执行结果如下（第 3 页）：",[1709,3783,3784,3798],{},[1712,3785,3786],{},[1715,3787,3788,3790,3792,3794,3796],{},[1718,3789,1720],{},[1718,3791,1723],{},[1718,3793,1694],{},[1718,3795,1728],{},[1718,3797,1731],{},[1733,3799,3800,3812,3824],{},[1715,3801,3802,3804,3806,3808,3810],{},[1738,3803,1839],{},[1738,3805,1842],{},[1738,3807,1763],{},[1738,3809,1799],{},[1738,3811,1849],{},[1715,3813,3814,3816,3818,3820,3822],{},[1738,3815,1854],{},[1738,3817,1857],{},[1738,3819,1698],{},[1738,3821,1862],{},[1738,3823,1865],{},[1715,3825,3826,3828,3830,3832,3834],{},[1738,3827,1870],{},[1738,3829,1873],{},[1738,3831,1876],{},[1738,3833,1766],{},[1738,3835,1881],{},[1531,3837,3838,3839,3842,3843,3845],{},"规律是：",[1891,3840,3841],{},"offset = (页码 - 1) × 每页条数","。做分页时一定要配合 ",[1535,3844,1541],{},"，否则每次返回的「第 2 页」可能不是同一批数据。",[1552,3847],{},[1526,3849,3851],{"id":3850},"聚合函数与-group-by","🧱 聚合函数与 GROUP BY",[1531,3853,3854,3855,3858],{},"有时候我们关心的不是每一行数据，而是统计结果，比如「一共有多少用户」「平均年龄多大」。这时用 ",[1891,3856,3857],{},"聚合函数","，它对一批数据做计算，返回一个值：",[1566,3860,3862],{"className":1568,"code":3861,"language":1570,"meta":1571,"style":1571},"-- 用户总数\nSELECT COUNT(*) FROM user;\n\n-- 年龄的总和、平均值、最大值、最小值\nSELECT SUM(age), AVG(age), MAX(age), MIN(age) FROM user;\n",[1535,3863,3864,3869,3874,3878,3883],{"__ignoreMap":1571},[1575,3865,3866],{"class":1577,"line":1578},[1575,3867,3868],{},"-- 用户总数\n",[1575,3870,3871],{"class":1577,"line":1584},[1575,3872,3873],{},"SELECT COUNT(*) FROM user;\n",[1575,3875,3876],{"class":1577,"line":1590},[1575,3877,1956],{"emptyLinePlaceholder":1955},[1575,3879,3880],{"class":1577,"line":1596},[1575,3881,3882],{},"-- 年龄的总和、平均值、最大值、最小值\n",[1575,3884,3885],{"class":1577,"line":1602},[1575,3886,3887],{},"SELECT SUM(age), AVG(age), MAX(age), MIN(age) FROM user;\n",[1531,3889,3890,1986],{},[1535,3891,3892],{},"SELECT COUNT(*) FROM user;",[1709,3894,3895,3902],{},[1712,3896,3897],{},[1715,3898,3899],{},[1718,3900,3901],{},"COUNT(*)",[1733,3903,3904],{},[1715,3905,3906],{},[1738,3907,1870],{},[1531,3909,3910,1986],{},[1535,3911,3912],{},"SELECT SUM(age), AVG(age), MAX(age), MIN(age) FROM user;",[1709,3914,3915,3931],{},[1712,3916,3917],{},[1715,3918,3919,3922,3925,3928],{},[1718,3920,3921],{},"SUM(age)",[1718,3923,3924],{},"AVG(age)",[1718,3926,3927],{},"MAX(age)",[1718,3929,3930],{},"MIN(age)",[1733,3932,3933],{},[1715,3934,3935,3938,3941,3943],{},[1738,3936,3937],{},"215",[1738,3939,3940],{},"26.8750",[1738,3942,1813],{},[1738,3944,1829],{},[1531,3946,3947,3948,3950],{},"这些聚合函数都会忽略 ",[1535,3949,1698],{},"，所以吴十不参与年龄的计算，平均值是 8 个人的平均值。",[1531,3952,3953,3955,3956,3959,3960,3962],{},[1535,3954,3901],{}," 统计所有行；",[1535,3957,3958],{},"COUNT(age)"," 只统计 ",[1535,3961,1694],{}," 不为 NULL 的行，所以我们这批数据的两个结果会不一样，可以动手验证一下。",[1531,3964,3965,3969],{},[1891,3966,3967],{},[1535,3968,1549],{}," 是分组统计：先按某个字段把数据分成若干组，再在每组里分别聚合。比如「每个城市有多少人」：",[1566,3971,3973],{"className":1568,"code":3972,"language":1570,"meta":1571,"style":1571},"SELECT city, COUNT(*) AS total\nFROM user\nGROUP BY city;\n",[1535,3974,3975,3980,3985],{"__ignoreMap":1571},[1575,3976,3977],{"class":1577,"line":1578},[1575,3978,3979],{},"SELECT city, COUNT(*) AS total\n",[1575,3981,3982],{"class":1577,"line":1584},[1575,3983,3984],{},"FROM user\n",[1575,3986,3987],{"class":1577,"line":1590},[1575,3988,3989],{},"GROUP BY city;\n",[1531,3991,2489],{},[1709,3993,3994,4003],{},[1712,3995,3996],{},[1715,3997,3998,4000],{},[1718,3999,1728],{},[1718,4001,4002],{},"total",[1733,4004,4005,4011,4017,4023],{},[1715,4006,4007,4009],{},[1738,4008,1749],{},[1738,4010,1774],{},[1715,4012,4013,4015],{},[1738,4014,1766],{},[1738,4016,1774],{},[1715,4018,4019,4021],{},[1738,4020,1799],{},[1738,4022,1757],{},[1715,4024,4025,4027],{},[1738,4026,1862],{},[1738,4028,1740],{},[1531,4030,4031,4032,4035,4036,4039],{},"可以把它类比成前端按城市 ",[1535,4033,4034],{},"reduce"," 归类后再数每组的长度。",[1535,4037,4038],{},"AS total"," 是给统计列起别名，让结果更好读。",[1552,4041],{},[1526,4043,4045],{"id":4044},"️-having分组之后再过滤","⚖️ HAVING：分组之后再过滤",[1531,4047,4048,2465,4050,4053,4054,1935],{},[1535,4049,1537],{},[1535,4051,4052],{},"HAVING"," 都是过滤，区别一句话说清：",[1891,4055,4056,4058,4059,4061],{},[1535,4057,1537],{}," 在分组前过滤行，",[1535,4060,4052],{}," 在分组后过滤组",[1531,4063,4064,4065,4067],{},"比如「人数超过 2 人的城市」，这个条件针对的是分组后的统计结果，只能写在 ",[1535,4066,4052],{}," 里：",[1566,4069,4071],{"className":1568,"code":4070,"language":1570,"meta":1571,"style":1571},"SELECT city, COUNT(*) AS total\nFROM user\nGROUP BY city\nHAVING total > 2;\n",[1535,4072,4073,4077,4081,4086],{"__ignoreMap":1571},[1575,4074,4075],{"class":1577,"line":1578},[1575,4076,3979],{},[1575,4078,4079],{"class":1577,"line":1584},[1575,4080,3984],{},[1575,4082,4083],{"class":1577,"line":1590},[1575,4084,4085],{},"GROUP BY city\n",[1575,4087,4088],{"class":1577,"line":1596},[1575,4089,4090],{},"HAVING total > 2;\n",[1531,4092,2489],{},[1709,4094,4095,4103],{},[1712,4096,4097],{},[1715,4098,4099,4101],{},[1718,4100,1728],{},[1718,4102,4002],{},[1733,4104,4105,4111],{},[1715,4106,4107,4109],{},[1738,4108,1749],{},[1738,4110,1774],{},[1715,4112,4113,4115],{},[1738,4114,1766],{},[1738,4116,1774],{},[1531,4118,4119,4120,4123,4124,4126],{},"广州 2 人、深圳 1 人不满足 ",[1535,4121,4122],{},"total > 2","，分组后被 ",[1535,4125,4052],{}," 筛掉了。",[1531,4128,4129,4130,2465,4132,4134],{},"如果只想统计部分城市，比如「只看北京和上海，且人数超过 2 人」，那就是 ",[1535,4131,1537],{},[1535,4133,4052],{}," 一起上：",[1566,4136,4138],{"className":1568,"code":4137,"language":1570,"meta":1571,"style":1571},"SELECT city, COUNT(*) AS total\nFROM user\nWHERE city IN ('北京', '上海')\nGROUP BY city\nHAVING total > 2;\n",[1535,4139,4140,4144,4148,4153,4157],{"__ignoreMap":1571},[1575,4141,4142],{"class":1577,"line":1578},[1575,4143,3979],{},[1575,4145,4146],{"class":1577,"line":1584},[1575,4147,3984],{},[1575,4149,4150],{"class":1577,"line":1590},[1575,4151,4152],{},"WHERE city IN ('北京', '上海')\n",[1575,4154,4155],{"class":1577,"line":1596},[1575,4156,4085],{},[1575,4158,4159],{"class":1577,"line":1602},[1575,4160,4090],{},[1531,4162,2489],{},[1709,4164,4165,4173],{},[1712,4166,4167],{},[1715,4168,4169,4171],{},[1718,4170,1728],{},[1718,4172,4002],{},[1733,4174,4175,4181],{},[1715,4176,4177,4179],{},[1738,4178,1749],{},[1738,4180,1774],{},[1715,4182,4183,4185],{},[1738,4184,1766],{},[1738,4186,1774],{},[1531,4188,4189,4190,4192,4193,4195,4196,4198],{},"执行顺序是：先用 ",[1535,4191,1537],{}," 筛行，再用 ",[1535,4194,1549],{}," 分组，最后用 ",[1535,4197,4052],{}," 筛组。",[1552,4200],{},[1526,4202,4204],{"id":4203},"小节总结","🧾 小节总结",[4206,4207,4208,4228,4250,4256,4263,4284],"ul",{},[4209,4210,4211,4213,4214,1931,4216,1931,4218,1931,4220,4222,4223,1931,4225,4227],"li",{},[1535,4212,1537],{}," 筛选行，常用运算符有 ",[1535,4215,1914],{},[1535,4217,1918],{},[1535,4219,1922],{},[1535,4221,1926],{},"，组合条件用 ",[1535,4224,2269],{},[1535,4226,2273],{},"，混用时记得加括号。",[4209,4229,4230,4233,4234,4236,4237,2072,4239,4241,4242,4244,4245,4247,4248,1935],{},[1535,4231,4232],{},"BETWEEN"," 查闭区间，",[1535,4235,2660],{}," 替代多个 ",[1535,4238,2273],{},[1535,4240,2808],{}," 配合 ",[1535,4243,2812],{}," 做模糊查询，查空值必须用 ",[1535,4246,1702],{}," 而不是 ",[1535,4249,2924],{},[4209,4251,4252,4255],{},[1535,4253,4254],{},"ORDER BY 列名 ASC/DESC"," 排序，多列排序时前面的列优先。",[4209,4257,4258,4260,4261,1935],{},[1535,4259,3680],{}," 做分页，offset = (页码 - 1) × 每页条数，分页一定要配 ",[1535,4262,1541],{},[4209,4264,4265,1931,4268,1931,4271,1931,4274,1931,4277,4280,4281,4283],{},[1535,4266,4267],{},"COUNT",[1535,4269,4270],{},"SUM",[1535,4272,4273],{},"AVG",[1535,4275,4276],{},"MAX",[1535,4278,4279],{},"MIN"," 做聚合统计，",[1535,4282,1549],{}," 按字段分组后分别统计。",[4209,4285,4286,4058,4288,4290],{},[1535,4287,1537],{},[1535,4289,4052],{}," 在分组后过滤组。",[1552,4292],{},[1526,4294,4296],{"id":4295},"知识问答","❓ 知识问答",[1531,4298,4299],{},[1891,4300,4301,4302,4304],{},"Q1：",[1535,4303,3115],{}," 为什么查不到年龄为空的用户？",[1531,4306,4307,4309,4310,4312,4313,1935],{},[1535,4308,1698],{}," 表示「未知」，它和任何值比较（包括它自己）结果都不是真，所以 ",[1535,4311,2924],{}," 永远匹配不到行。正确写法是 ",[1535,4314,4315],{},"WHERE age IS NULL",[1531,4317,4318],{},[1891,4319,4320,4321,4324],{},"Q2：",[1535,4322,4323],{},"LIMIT 3, 3"," 里的两个数字分别是什么意思？",[1531,4326,4327,4328,4330],{},"第一个数是跳过的条数（offset），第二个数是取的条数（count）。",[1535,4329,4323],{}," 就是跳过前 3 条，再取 3 条，对应「每页 3 条时的第 2 页」。",[1531,4332,4333],{},[1891,4334,4335,4336,2465,4338,4340],{},"Q3：",[1535,4337,3901],{},[1535,4339,3958],{}," 有什么区别？",[1531,4342,4343,4345,4346,3959,4348,4350],{},[1535,4344,3901],{}," 统计所有行，不管字段是不是 NULL；",[1535,4347,3958],{},[1535,4349,1694],{}," 不为 NULL 的行。本文示例中两条语句的结果不同，原因就在这里。",[1531,4352,4353],{},[1891,4354,4355],{},"Q4：聚合统计时为什么城市为空的行也出现在结果里？",[1531,4357,4358,4360,4361,4363,4364,4367],{},[1535,4359,1549],{}," 会把 ",[1535,4362,1698],{}," 也当成一个分组。如果不想看到它，在分组前加 ",[1535,4365,4366],{},"WHERE city IS NOT NULL"," 过滤掉即可。",[1531,4369,4370],{},[1891,4371,4372,4373,2465,4375,4377],{},"Q5：",[1535,4374,1537],{},[1535,4376,4052],{}," 能互换吗？",[1531,4379,4380,4381,4383,4384,4386,4387,4389,4390,4392],{},"不能。",[1535,4382,1537],{}," 在分组前执行，里面不能用聚合结果；",[1535,4385,4052],{}," 在分组后执行，专门筛分组后的统计值。能放在 ",[1535,4388,1537],{}," 里的条件就尽量放 ",[1535,4391,1537],{},"，先筛掉数据再分组，效率更高。",[1552,4394],{},[1526,4396,4398],{"id":4397},"小练习","🧪 小练习",[1531,4400,4401,4402,4404],{},"基于本文开头的 ",[1535,4403,1563],{}," 示例数据，完成下面两个查询：",[4406,4407,4408],"ol",{},[4209,4409,4410],{},"查出「年龄在 20 到 30 岁之间，且来自北京或上海」的用户，按年龄从大到小排序。",[1566,4412,4414],{"className":1568,"code":4413,"language":1570,"meta":1571,"style":1571},"-- 请在这里编写 SQL\n\n",[1535,4415,4416],{"__ignoreMap":1571},[1575,4417,4418],{"class":1577,"line":1578},[1575,4419,4420],{},"-- 请在这里编写 SQL\n",[4406,4422,4423],{"start":1584},[4209,4424,4425],{},"统计每个城市的平均年龄，只保留平均年龄大于 26 的城市。",[1566,4427,4428],{"className":1568,"code":4413,"language":1570,"meta":1571,"style":1571},[1535,4429,4430],{"__ignoreMap":1571},[1575,4431,4432],{"class":1577,"line":1578},[1575,4433,4420],{},[1552,4435],{},[1531,4437,4438],{},"🎉 恭喜你已经掌握 MySQL 条件查询与分页统计技能啦！下一篇我们聊聊数据类型与约束，看看建表时每个字段该怎么选类型、怎么防止脏数据混进表里。",[4440,4441,4442],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":1571,"searchDepth":1584,"depth":1584,"links":4444},[4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,4456],{"id":1528,"depth":1584,"text":1529},{"id":1556,"depth":1584,"text":1557},{"id":1886,"depth":1584,"text":1887},{"id":2262,"depth":1584,"text":2263},{"id":2555,"depth":1584,"text":2556},{"id":3127,"depth":1584,"text":3128},{"id":3594,"depth":1584,"text":3595},{"id":3850,"depth":1584,"text":3851},{"id":4044,"depth":1584,"text":4045},{"id":4203,"depth":1584,"text":4204},{"id":4295,"depth":1584,"text":4296},{"id":4397,"depth":1584,"text":4398},"掌握 WHERE 条件查询、ORDER BY 排序、LIMIT 分页和聚合分组统计，能从表中筛出想要的数据。","md",null,{},{"title":1288},{"title":1521,"description":4457},"cLlNwu8USx",[4465,4467],{"title":1284,"path":1285,"stem":1286,"description":4466,"children":-1},"学会创建数据库和数据表，掌握 INSERT、SELECT、UPDATE、DELETE 四种基本操作。",{"title":1292,"path":1293,"stem":1294,"description":4468,"children":-1},"掌握 MySQL 常用数据类型的选型思路和常用约束，能设计出结构合理的表。",1784715108397]