Home > database > The oracle database group by statement and having statements
The oracle database group by statement and having statements
Time:09-29
Problem: query to borrow the title of the mechanical industry publishing house number is contained in "according to library book" three word book but no borrowing number is contained in the title of science publishing house, 'according to library books' three words book reader's name, title, (personal understanding: the reader must borrow from the mechanical industry publishing house of books containing database, but the reader may borrow the database is not included in the title of scientific publishing false books, or may not have to borrow a book published by science press books, but if the readers borrow the title of science publishing house of books in the database is contained in three words, does not conform to the requirements) to write code in which of the following is my up sqlplus:
(there are three tables: book, the reader, borrow, borrow the book table and reader table father watch is) (my understanding is first write want to query the columns: name of readers and book title, then connect the three tables, elected according to the condition to borrow the title of the mechanical industry publishing house of books in the database is contained in three words, and then grouped by borrowing to name them, selected from groups meet the conditions of the people, but why not? Then there is the back of the group by must follow by a select statement with the column name?????? )
CodePudding user response:
group by behind must be followed a select statement with the column name??????
Behind the select of aggregate column, must be in the group by the back,