当前位置: 首页 > 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 

相关文章:

  • 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 记录】
  • 海军“吉祥方舟”号医院船开展海上卫勤演练
  • 广东茂名高州市山体滑坡已致3死1失联,搜救仍在继续
  • 左手免费午餐右手花开岭,邓飞14年公益之路的中国贡献
  • 83岁山水花鸟画家、书法家吴静山离世,系岭南画派代表人物
  • 体育文化赋能国际交流,上海黄浦举办国际友人城市定向赛
  • 上海将建设万兆小区、园区及工厂,为模型训练数据的传输提供硬件支持