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 ```