Skip to content

Mysql学习笔记

About 149 wordsLess than 1 minute

mysql

2024-06-04

1、char_length() 求字符串的长度

select tweet_id from tweets where char_length(content) > 15

2、性能问题

这两个sql到底是按个更快一点?

Sql1
select customer_id, count(visit_id) as count_no_trans 
from visits where visit_id not in (
    select distinct visit_id from transactions
)
group by customer_id

3、datediff(date1, date2)获取时间差

select a.id from weather as a 
join weather as b on datediff(a.recordDate, b.recordDate) = 1  
-- 这里datediff(a.recordDate, b.recordDate) = 1就表示a.date - b.date = 1
where a.temperature > b.temperature;

Changelog

Last Updated: View All Changelog
  • feat(wiki): hammeSpoon: 复制出来的文件需要重新生成永链

    On 3/27/25

求求了,快滚去学习!!!

求求了求求了,快去学习吧!

【题单】贪心算法

不知道方向的时候,可以多看看书,书会给你指明下一步该干什么,加油!