• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
爱白菜的小昆虫
博客园    首页    新随笔    联系   管理    订阅  订阅
2015年4月24日
SQL isnull函数
摘要: select * from emp;--就算年收入:sal*12+comm,sal为月工资,comm为年薪select ename, sal*12+isnull(comm, 0) from emp;--为什么要使用isnull函数,因为null值不能参加运算select ename, sal*12+... 阅读全文
posted @ 2015-04-24 12:24 爱白菜的小昆虫 阅读(283) 评论(0) 推荐(0)
SQL null值 查询null
摘要: select * from emp;--查询comm为null的员工信息select * from emp where comm is null;--查询comm不为null的员工信息select * from emp where comm is not null; 阅读全文
posted @ 2015-04-24 12:12 爱白菜的小昆虫 阅读(291) 评论(0) 推荐(0)
SQL top order between 一起使用
摘要: select * from emp;--输出工资在[1500,3000]范围之内的工资最高的前5个员工信息select top 5 * from emp where sal between 1500 and 3000 order by sal desc; 阅读全文
posted @ 2015-04-24 11:41 爱白菜的小昆虫 阅读(415) 评论(0) 推荐(0)
SQL order 排序
摘要: select * from emp;--按照工资升序排序select * from emp order by sal;--按照工资降序排序select * from emp order by sal desc; 阅读全文
posted @ 2015-04-24 11:34 爱白菜的小昆虫 阅读(224) 评论(0) 推荐(0)
SQL top查询
摘要: select *from emp;--查询表前5行 员工信息select top 5 * from emp;--查询表前15%行的员工信息select top 15 percent * from emp; 阅读全文
posted @ 2015-04-24 00:14 爱白菜的小昆虫 阅读(348) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3