当前位置: 首页 > news >正文

二十、MySQL-DQL-条件查询

DQL-条件查询

DQL-条件查询

代码: DQL-条件查询

-- 1.查询 姓名 为 杨逍 的员工
select * from tb_emp where name = '杨逍';
-- 2.查询 id小于等于5 的员工信息
select * from tb_emp where id <= 5;
-- 3.查询 没有分配职位 的员工信息
select * from tb_emp where job is null;
-- 4.查询 有职位 的员工信息
select * from tb_emp where job is not null;
-- 5.查询密码不等于 '123456' 的员工信息
select * from tb_emp where password != '123456';
select * from tb_emp where password <> '123456';
-- 6.查询入职日期在 '2000-01-01'(包含)到 '2010-01-01'(包含)之间的员工信息
select * from tb_emp where entrydate >= '2000-01-01' and entrydate <= '2010-01-01';
select * from tb_emp where entrydate between '2000-01-01' and  '2010-01-01';
-- 7.查询入联时间在2000-01-01'(包含)到'2010-01-01'(包含)之间且性别为女的员工信息
select * from tb_emp where entrydate between '2000-01-01' and  '2010-01-01' and gender = 2;
-- 8:查询职位是2(讲师),3(学工主管),4(教研主管)的员工信息
select * from tb_emp where job = 2 or  job = 3 or  job = 4;
select * from tb_emp where job in (2,3,4);
-- 9·查询 姓名 为两个字的员工信息
select * from tb_emp where name like '__';
-- 10.查询 姓'张'的员工信息
select * from tb_emp where name like '张%';
http://www.lryc.cn/news/615603.html

相关文章:

  • Kotlin初体验
  • DeepSeek智能考试系统智能体
  • 在 VS Code 或 Visual Studio 2022 上搭建 ESP32-CAM 开发环境
  • Vulnhub----Beelzebub靶场
  • Day 20 奇异值SVD分解
  • 前端懒加载技术全面解析
  • 衰减器的计算
  • 【文献阅读】我国生态问题鉴定与国土空间生态保护修复方向
  • BeanDefinition 与 Bean 生命周期(面试高频考点)
  • C#异步编程双利器:异步Lambda与BackgroundWorker实战解析
  • 104-基于Flask的优衣库销售数据可视化分析系统
  • Python day39
  • PG靶机 - Shiftdel
  • 大语言模型提示工程与应用:前沿提示工程技术探索
  • AcWing 4579. 相遇问题
  • Horse3D引擎研发笔记(三):使用QtOpenGL的Shader编程绘制彩色三角形
  • 企业级高性能web服务器
  • 香橙派 RK3588 部署千问大模型 Qwen2-VL-2B 推理视频
  • Kubernetes CronJob bug解决
  • 前端工程化:从构建工具到性能监控的全流程实践
  • 应用层Http协议(1)
  • Spring框架基础
  • 黑马SpringAI项目-聊天机器人
  • 力扣热题100------70.爬楼梯
  • Day38--动态规划--322. 零钱兑换,279. 完全平方数,139. 单词拆分,56. 携带矿石资源(卡码网),背包问题总结
  • 原生Vim操作大全
  • 大模型“涌现”背后的暗线——规模、数据、目标函数的三重协奏
  • 算法_python_学习记录_02
  • linux 操作ppt
  • Uipath Studio中邮件自动化