摘要:
# 分组查询时,select的字段是否一定要都在group by中? 分组查询关键字group by通常和集合函数(MAX、MIN、COUNT、SUM、AVG)一起使用,它可以对一列或者多列结果集进行分组。例如要统计超市水果的种类,需要用count函数,要统计哪个水果价格最高,要用MAX()函数。 阅读全文
摘要:
# MySQL NULL 值判断 ## IFNULL 函数 IFNULL(expr1,expr2)用法:假如expr1不为NULL,则 IFNULL() 的返回值为expr1; 否则其返回值为 expr2。IFNULL()的返回值是数字或是字符串,具体情况取决于其所使用的语境。 - ~~~sql m 阅读全文
摘要:
# SQL Date 函数 ## 一、SQL 日期 当我们处理日期时,最难的任务恐怕是确保所插入的日期的格式,与数据库中日期列的格式相匹配。 只要数据包含的只是日期部分,运行查询就不会出问题。但是,如果涉及时间,情况就有点复杂了。 在讨论日期查询的复杂性之前,我们先来看看最重要的内建日期处理函数。 阅读全文
摘要:
# 可回收且低脂的产品 > 原文地址:[1757. 可回收且低脂的产品 - 力扣(LeetCode)](https://leetcode.cn/problems/recyclable-and-low-fat-products/) - 题目如下所示 ](https://leetcode.cn/problems/find-total-time-spent-by-each-employee/) - 题目如下所示. ](https://leetcode.cn/problems/find-followers-count/) - 题目如下所示 ](https://leetcode.cn/problems/daily-leads-and-partners/) - 题目如下所示 ](https://leetcode.cn/problems/fix-names-in-a-table/) - 题目如下所示 ](https://leetcode.cn/problems/bank-account-summary-ii/) - 题目如下所示 ](https://leetcode.cn/problems/customer-who-visited-but-did-not-make-any-transactions/) - 题目如下 阅读全文