2026.3.30MySQL 基础查询语句

📅 发布时间:2026/7/10 4:01:47 👁️ 浏览次数:
2026.3.30MySQL 基础查询语句
基础查询语句SELECT * FROMstudent加上筛选where筛选对应的列studentName like ‘%C%’;开头字母必须是C开头的·或以某结尾SELECT * FROMstudentwhere studentName like ‘C%’;SELECT * FROMstudentwhere studentName like ‘%z’;中间的SELECT * FROMstudentwhere studentName like ‘% C%’;做文字长度筛选select * from student where national like ‘_’ ornational like ‘__’;其中_下划线代表匹配任意单个字符其中%百分号代表匹配任意长度字符使用正则表达式查询5月和9月过生日的人员列表返回sqlselect * from student where 正则筛选AI返回SQL如下– 匹配生日字段中 月份为 05 或 09 / 5 或 9 的所有学生SELECT * FROM studentWHERE birthday REGEXP ‘-(0?5|0?9)-’;