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

d2025328

一、sql-判断三角形

610. 判断三角形 - 力扣(LeetCode)

用一下if加上判断条件

select x,y,z,if(x+y > z and x+z > y and y+z > x
and x-y < z and x-z < y and y-z < x,'Yes','No') as 'triangle'
from Triangle

二、按照分类统计薪水

1907. 按分类统计薪水 - 力扣(LeetCode)

if判断加count 统计+union

select 'Low Salary' as 'category',count(if(income < 20000,1,null)) as 'accounts_count' from Accounts
union
select 'Average Salary' as 'category',count(if(income >= 20000 and income <= 50000,1,null)) as 'accounts_count' from Accounts
union  
select 'High Salary' as 'category',count(if(income > 50000,1,null)) as 'accounts_count' from Accounts

三、上级经理已离职的公司员工

1978. 上级经理已离职的公司员工 - 力扣(LeetCode)

子查询没啥好说的

select employee_id
from Employees
where manager_id is not null 
and salary < 30000 
and manager_id not in (select employee_id from Employees)
order by employee_id asc 
http://www.dtcms.com/a/96711.html

相关文章:

  • LAC自动建立L2TP
  • 如何做管理
  • Python Random 模块使用完全指南
  • 【leetcode hot 100 55】跳跃游戏
  • 深入探索 libarchive
  • 【机器人-开发工具】ROS 2(3)常见工具软件安装(2025持续更新......)
  • stress 和 stress-ng(增强版) -压力测试工具
  • linux挂载磁盘
  • Go 语言标准库中database模块详细功能介绍与示例
  • Ingredient-oriented Multi-Degradation Learning for Image Restoration论文阅读
  • git:远程仓库拉取到本地,fork到本地,修改后再上传
  • 【每日论文】Qwen2.5-Omni Technical Report
  • 前端性能优化思路_场景题
  • C#Lambda表达式与委托关系
  • 平台清洗行动:AI浏览器用户生存率高出传统方案17倍
  • Gradle实战指南:从入门到进阶,与Maven的深度对比
  • -PHP 应用SQL 二次注入堆叠执行DNS 带外功能点黑白盒条件
  • 人工智能算法、模型、框架
  • 剑指Offer35- - 链表
  • 【剪辑_BGM 记录】
  • matplotlib学习
  • MySQL INSERT 语句:当记录不存在时插入
  • Centos7 安装 TDengine
  • springMVC中转发和重定向的简介及写法
  • TextGrad:案例
  • 生成信息提取的大型语言模型综述
  • Java异常架构
  • 音频知识 参数分析
  • 决策树算法详解:从西瓜分类到实战应用
  • 第一天学习 TypeScript :从零基础到环境搭建与基础语法实践