摘要: # 分组查询时,select的字段是否一定要都在group by中? 分组查询关键字group by通常和集合函数(MAX、MIN、COUNT、SUM、AVG)一起使用,它可以对一列或者多列结果集进行分组。例如要统计超市水果的种类,需要用count函数,要统计哪个水果价格最高,要用MAX()函数。 阅读全文
posted @ 2023-07-11 16:38 OnlyOnYourself-Lzw 阅读(887) 评论(0) 推荐(0) 编辑
摘要: # MySQL NULL 值判断 ## IFNULL 函数 IFNULL(expr1,expr2)用法:假如expr1不为NULL,则 IFNULL() 的返回值为expr1; 否则其返回值为 expr2。IFNULL()的返回值是数字或是字符串,具体情况取决于其所使用的语境。 - ~~~sql m 阅读全文
posted @ 2023-07-11 16:37 OnlyOnYourself-Lzw 阅读(144) 评论(0) 推荐(0) 编辑
摘要: # SQL Date 函数 ## 一、SQL 日期 当我们处理日期时,最难的任务恐怕是确保所插入的日期的格式,与数据库中日期列的格式相匹配。 只要数据包含的只是日期部分,运行查询就不会出问题。但是,如果涉及时间,情况就有点复杂了。 在讨论日期查询的复杂性之前,我们先来看看最重要的内建日期处理函数。 阅读全文
posted @ 2023-07-11 16:36 OnlyOnYourself-Lzw 阅读(8) 评论(0) 推荐(0) 编辑
摘要: # 可回收且低脂的产品 > 原文地址:[1757. 可回收且低脂的产品 - 力扣(LeetCode)](https://leetcode.cn/problems/recyclable-and-low-fat-products/) - 题目如下所示 ![](https://img2023.cnblog 阅读全文
posted @ 2023-07-11 16:34 OnlyOnYourself-Lzw 阅读(10) 评论(0) 推荐(0) 编辑
摘要: # 查找每个员工花费的总时间 > 原文地址:[1741. 查找每个员工花费的总时间 - 力扣(LeetCode)](https://leetcode.cn/problems/find-total-time-spent-by-each-employee/) - 题目如下所示. ![](https:// 阅读全文
posted @ 2023-07-11 16:33 OnlyOnYourself-Lzw 阅读(14) 评论(0) 推荐(0) 编辑
摘要: # 求关注者的数量 > 原文地址:[1729. 求关注者的数量 - 力扣(LeetCode)](https://leetcode.cn/problems/find-followers-count/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904 阅读全文
posted @ 2023-07-11 16:32 OnlyOnYourself-Lzw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: # 每天的领导和合伙人 > 原文地址:[1693. 每天的领导和合伙人 - 力扣(LeetCode)](https://leetcode.cn/problems/daily-leads-and-partners/) - 题目如下所示 ![](https://img2023.cnblogs.com/b 阅读全文
posted @ 2023-07-11 16:30 OnlyOnYourself-Lzw 阅读(5) 评论(0) 推荐(0) 编辑
摘要: # 修复表中的名字 > 原文地址:[1667. 修复表中的名字 - 力扣(LeetCode)](https://leetcode.cn/problems/fix-names-in-a-table/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904 阅读全文
posted @ 2023-07-11 16:01 OnlyOnYourself-Lzw 阅读(5) 评论(0) 推荐(0) 编辑
摘要: # 银行账户概要 II > 原文地址:[1587. 银行账户概要 II - 力扣(LeetCode)](https://leetcode.cn/problems/bank-account-summary-ii/) - 题目如下所示 ![](https://img2023.cnblogs.com/bl 阅读全文
posted @ 2023-07-11 15:58 OnlyOnYourself-Lzw 阅读(10) 评论(0) 推荐(0) 编辑
摘要: # 进店却未进行过交易的顾客 > 原文地址:[1581. 进店却未进行过交易的顾客 - 力扣(LeetCode)](https://leetcode.cn/problems/customer-who-visited-but-did-not-make-any-transactions/) - 题目如下 阅读全文
posted @ 2023-07-11 15:54 OnlyOnYourself-Lzw 阅读(17) 评论(0) 推荐(0) 编辑