tailieunhanh - Hướng dẫn học Microsoft SQL Server 2008 part 156

Bộ dữ liệu và bộ đơn giản Như trình bày trước đó trong phần''Cube biểu,''bộ dữ liệu được xây dựng bằng cách liệt kê một thành viên của hệ thống phân cấp từng, hoặc, nếu thành viên không được rõ ràng quy định cho một hệ thống phân cấp cụ thể, các thành viên mặc định (thường là [Tất cả] cấp) cho rằng hệ thống phân cấp là hoàn toàn bao gồm trong các tuple. | PartX Business Intelligence Tuples and simple sets As outlined earlier in the section Cube Addressing tuples are constructed by listing one member from each hierarchy or if no member is explicitly specified for a particular hierarchy the default member usually the All level for that hierarchy is implicitly included in the tuple. Parentheses are used to group the tuple s member list. For example the following tuple references all the cells that contain Internet sales volume for German customers over all time all territories all products and so on Customer . Country . Country . Germany Measures . Internet Sales Amount This example includes a measure which is part of every tuple. Unlike a dimension it is not possible to have an All level when it is omitted but the cube can be configured with a default measure which will be used if no measure is specified. Also notice the simplified syntax to refer to a measure Measures . Measure Name . When a simple tuple is specified with only one hierarchy member the parentheses can be omitted so all German customers becomes the following Customer . Country . Country . Germany . The simplest way to build a set is by listing one or more tuples inside of braces. For example using simple tuples without parentheses the following is a set of French and German customers Customer . Country . Country . France Customer . Country . Country . Germany Basic SELECT statement Simple sets enable the construction of a basic SELECT statement. The following example query returns Internet sales to French and German customers for the calendar years 2003 and 2004 SELECT Customer . Country . Country . France Customer . Country . Country . Germany ON COLUMNS Date . Calendar Year . Calendar Year . 2003 Date . Calendar Year . Calendar Year . 2004 ON ROWS FROM Adventure Works WHERE Measures . Internet Sales Amount r- r - All queries in this chapter are constructed to run against the AdventureWorks Cube sam- 1 ples for SQL Server 2008. See .