摘要: # 分组查询时,select的字段是否一定要都在group by中? 分组查询关键字group by通常和集合函数(MAX、MIN、COUNT、SUM、AVG)一起使用,它可以对一列或者多列结果集进行分组。例如要统计超市水果的种类,需要用count函数,要统计哪个水果价格最高,要用MAX()函数。 阅读全文
posted @ 2023-07-11 16:38 OnlyOnYourself-Lzw 阅读(1233) 评论(0) 推荐(0) 编辑
摘要: # MySQL NULL 值判断 ## IFNULL 函数 IFNULL(expr1,expr2)用法:假如expr1不为NULL,则 IFNULL() 的返回值为expr1; 否则其返回值为 expr2。IFNULL()的返回值是数字或是字符串,具体情况取决于其所使用的语境。 - ~~~sql m 阅读全文
posted @ 2023-07-11 16:37 OnlyOnYourself-Lzw 阅读(195) 评论(0) 推荐(0) 编辑
摘要: # SQL Date 函数 ## 一、SQL 日期 当我们处理日期时,最难的任务恐怕是确保所插入的日期的格式,与数据库中日期列的格式相匹配。 只要数据包含的只是日期部分,运行查询就不会出问题。但是,如果涉及时间,情况就有点复杂了。 在讨论日期查询的复杂性之前,我们先来看看最重要的内建日期处理函数。 阅读全文
posted @ 2023-07-11 16:36 OnlyOnYourself-Lzw 阅读(12) 评论(0) 推荐(0) 编辑
摘要: # 可回收且低脂的产品 > 原文地址:[1757. 可回收且低脂的产品 - 力扣(LeetCode)](https://leetcode.cn/problems/recyclable-and-low-fat-products/) - 题目如下所示 ![](https://img2023.cnblog 阅读全文
posted @ 2023-07-11 16:34 OnlyOnYourself-Lzw 阅读(12) 评论(0) 推荐(0) 编辑
摘要: # 查找每个员工花费的总时间 > 原文地址:[1741. 查找每个员工花费的总时间 - 力扣(LeetCode)](https://leetcode.cn/problems/find-total-time-spent-by-each-employee/) - 题目如下所示. ![](https:// 阅读全文
posted @ 2023-07-11 16:32 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:31 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:00 OnlyOnYourself-Lzw 阅读(7) 评论(0) 推荐(0) 编辑
摘要: # 银行账户概要 II > 原文地址:[1587. 银行账户概要 II - 力扣(LeetCode)](https://leetcode.cn/problems/bank-account-summary-ii/) - 题目如下所示 ![](https://img2023.cnblogs.com/bl 阅读全文
posted @ 2023-07-11 15:57 OnlyOnYourself-Lzw 阅读(13) 评论(0) 推荐(0) 编辑
摘要: # 进店却未进行过交易的顾客 > 原文地址:[1581. 进店却未进行过交易的顾客 - 力扣(LeetCode)](https://leetcode.cn/problems/customer-who-visited-but-did-not-make-any-transactions/) - 题目如下 阅读全文
posted @ 2023-07-11 15:53 OnlyOnYourself-Lzw 阅读(20) 评论(0) 推荐(0) 编辑
摘要: # 患某种疾病的患者 > 原文地址:[1527. 患某种疾病的患者 - 力扣(LeetCode)](https://leetcode.cn/problems/patients-with-a-condition/) - 题目如下所示 ![](https://img2023.cnblogs.com/bl 阅读全文
posted @ 2023-07-11 15:49 OnlyOnYourself-Lzw 阅读(18) 评论(0) 推荐(0) 编辑
摘要: # 按日期分组销售产品 > 原文地址:[1484. 按日期分组销售产品 - 力扣(LeetCode)](https://leetcode.cn/problems/group-sold-products-by-the-date/) - 题目如下所示 ![](https://img2023.cnblog 阅读全文
posted @ 2023-07-11 15:47 OnlyOnYourself-Lzw 阅读(12) 评论(0) 推荐(0) 编辑
摘要: # 排名靠前的旅行者 > 原文地址:[1407. 排名靠前的旅行者 - 力扣(LeetCode)](https://leetcode.cn/problems/top-travellers/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904930/ 阅读全文
posted @ 2023-07-11 15:44 OnlyOnYourself-Lzw 阅读(16) 评论(0) 推荐(0) 编辑
摘要: # 文章浏览 Ⅰ > 原文地址:[1148. 文章浏览 I - 力扣(LeetCode)](https://leetcode.cn/problems/article-views-i/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904930/202 阅读全文
posted @ 2023-07-11 15:41 OnlyOnYourself-Lzw 阅读(16) 评论(0) 推荐(0) 编辑
摘要: # 查询近30天活跃用户数 > 原文地址:[1141. 查询近30天活跃用户数 - 力扣(LeetCode)](https://leetcode.cn/problems/user-activity-for-the-past-30-days-i/) - 题目如下所示 ![](https://img20 阅读全文
posted @ 2023-07-11 15:39 OnlyOnYourself-Lzw 阅读(65) 评论(0) 推荐(0) 编辑
摘要: # 销售分析 Ⅲ > 原文地址:[1084. 销售分析III - 力扣(LeetCode)](https://leetcode.cn/problems/sales-analysis-iii/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904930 阅读全文
posted @ 2023-07-11 15:29 OnlyOnYourself-Lzw 阅读(9) 评论(0) 推荐(0) 编辑
摘要: # 合作过至少三次的演员和导演 > 原文地址:[1050. 合作过至少三次的演员和导演 - 力扣(LeetCode)](https://leetcode.cn/problems/actors-and-directors-who-cooperated-at-least-three-times/) - 阅读全文
posted @ 2023-07-11 15:25 OnlyOnYourself-Lzw 阅读(4) 评论(0) 推荐(0) 编辑
摘要: # 变更性别 > 原文地址:[627. 变更性别 - 力扣(LeetCode)](https://leetcode.cn/problems/swap-salary/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904930/202307/29049 阅读全文
posted @ 2023-07-11 15:21 OnlyOnYourself-Lzw 阅读(6) 评论(0) 推荐(0) 编辑
摘要: # 销售员 > 原文地址:[607. 销售员 - 力扣(LeetCode)](https://leetcode.cn/problems/sales-person/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904930/202307/290493 阅读全文
posted @ 2023-07-11 15:19 OnlyOnYourself-Lzw 阅读(15) 评论(0) 推荐(0) 编辑
摘要: # 大的国家 > 原文地址:[595. 大的国家 - 力扣(LeetCode)](https://leetcode.cn/problems/big-countries/) - 题目如下所示 ![](https://img2023.cnblogs.com/blog/2904930/202307/290 阅读全文
posted @ 2023-07-11 15:16 OnlyOnYourself-Lzw 阅读(9) 评论(0) 推荐(0) 编辑