Auto commit
This commit is contained in:
		
							parent
							
								
									53aacb1dee
								
							
						
					
					
						commit
						522e2388ca
					
				| @ -243,7 +243,21 @@ WHERE b.note = a.author_name | ||||
| GROUP BY a.author_id | ||||
| HAVING COUNT(*) > 1; | ||||
| 
 | ||||
| #9 视图 | ||||
| CREATE VIEW v_book AS | ||||
| SELECT b.genre, a.author_name, COUNT(*) c | ||||
| FROM tb_books b, tb_authors a | ||||
| WHERE b.note = a.author_name | ||||
| GROUP BY b.genre, a.author_id  | ||||
| HAVING COUNT(*) = ( | ||||
| 	SELECT COUNT(*) | ||||
| 	FROM tb_books | ||||
| 	WHERE b.genre = genre | ||||
| 	GROUP BY note | ||||
| 	ORDER BY COUNT(*) DESC | ||||
| 	LIMIT 1 | ||||
| ); | ||||
| 
 | ||||
| 
 | ||||
| #9 | ||||
| ``` | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user