TAILIEUCHUNG - OCA /OCP Oracle Database 11g A ll-in-One Exam Guide- P52

OCA /OCP Oracle Database 11g A ll-in-One Exam Guide- P52:There is an ever increasing demand for staff with IT industry certification. The benefits to employers are significant—they can be certain that staff have a certain level of competence—and the benefits to the individuals, in terms of demand for their services, are equally great. Many employers are now requiring technical staff to have certifications, and many IT purchasers will not buy from firms that do not have certified staff. | OCA OCP Oracle Database 11g All-in-One Exam Guide 466 Figure 11-2 Unique DEPARTMENT_ID values in the EMPLOYEES table TIP Grouping data and using summary functions are widely utilized for reporting purposes. It is valuable to practice the segmentation of a set of data into different groups. Oracle provides the analytical language to deconstruct datasets into groups divide these into further subgroups and so on. Aggregate grouping functions can then be executed against these groups and subgroups. The GROUP BY Clause The SELECT statement is enhanced by the addition of the GROUP BY clause. This clause facilitates the creation of groups. It appears after the WHERE clause but before the ORDER BY clause as follows Chapter 11 Group Functions 467 SELECT column expression group_function column expression alias . FROM table WHERE condition s GROUP BY col s expr ORDER BY col s expr numeric_pos ASC DESC NULLS FIRST LAST The column or expression specified in the GROUP BY clause is also known as the grouping attribute and is the component that rows are grouped by. The dataset is segmented according to the grouping attribute. Consider the following query select max salary count from employees group by department_id order by department_id The grouping attribute in this example is the DEPARTMENT_ID column. The dataset on which the group functions in the SELECT list must operate is divided into 12 groups one for each department. For each group department the maximum salary value and the number of rows are returned. Since the results are sorted by DEPARTMENT_ID the third row in the set of results contains the values 11000 and 6. This indicates that 6 employees have a DEPARTMENT_ID value of 30. Of these 6 the highest earner has a SALARY value of 11000. This query demonstrates that the grouping attribute does not have to be included in the SELECT list. It is common to see the grouping attribute in the SELECT list alongside grouping functions. If an item that is not a group function .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.