Auto commit
This commit is contained in:
parent
9219d6cc3c
commit
53aacb1dee
@ -230,13 +230,19 @@ FROM tb_books b;
|
|||||||
UPDATE tb_books b
|
UPDATE tb_books b
|
||||||
SET b.note = SUBSTR(b.note,INSTR(b.note,'-')+2);
|
SET b.note = SUBSTR(b.note,INSTR(b.note,'-')+2);
|
||||||
|
|
||||||
#7 tj11
|
#7 tj11 多表连接+条件+排序
|
||||||
SELECT b.book_id, b.title, a.author_id, a.author_name, b.publication_date
|
SELECT b.book_id, b.title, a.author_id, a.author_name, b.publication_date
|
||||||
FROM tb_books b, tb_authors a
|
FROM tb_books b, tb_authors a
|
||||||
WHERE b.note = a.author_name AND YEAR(b.publication_date) BETWEEN 1980 AND 2010
|
WHERE b.note = a.author_name AND YEAR(b.publication_date) BETWEEN 1980 AND 2010
|
||||||
ORDER BY b.publication_date DESC;
|
ORDER BY b.publication_date DESC;
|
||||||
|
|
||||||
#8
|
#8 tj12 多表连接+分组+分组后条件
|
||||||
|
SELECT a.author_id, a.author_name, COUNT(*)
|
||||||
|
FROM tb_books b, tb_authors a
|
||||||
|
WHERE b.note = a.author_name
|
||||||
|
GROUP BY a.author_id
|
||||||
|
HAVING COUNT(*) > 1;
|
||||||
|
|
||||||
|
|
||||||
#9
|
#9
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user