From 813d3b3be4378ea6813de128a406e0a0d975a535 Mon Sep 17 00:00:00 2001 From: smallkun Date: Thu, 27 Feb 2025 17:21:28 +0800 Subject: [PATCH] Auto commit --- 2208/天天乐学考试答案/MySQL练习(一).md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/2208/天天乐学考试答案/MySQL练习(一).md b/2208/天天乐学考试答案/MySQL练习(一).md index 4caee37..e827cbf 100644 --- a/2208/天天乐学考试答案/MySQL练习(一).md +++ b/2208/天天乐学考试答案/MySQL练习(一).md @@ -222,6 +222,22 @@ SET a.avatar = LOAD_FILE('C:/TTLXExam/20501071168/MYSQLDB/3/jinyong.jpg') WHERE a.author_name = '金庸'; #6 +#INSTR(主串, 子串) 判断子串在主串中的位置并返回 +#SUBSTR(字符串, 起始位置) 从起始位置开始截取字符串 +SELECT SUBSTR(b.note,INSTR(b.note,'-')+2) +FROM tb_books b; +UPDATE tb_books b +SET b.note = SUBSTR(b.note,INSTR(b.note,'-')+2); + +#7 +SELECT b.book_id, b.title, +FROM tb_books b +WHERE YEAR(b.publication_date) BETWEEN 1980 AND 2010 +ORDER BY + +#8 + +#9 ```