I got this example from the sql msdn, but when it runs in the query analyser I get the message: error
Line 1: Incorrect syntax near ','.
Line 4 idem
Line 7 idem
A rowset hierarchy is a collection of rowsets linked together via chapters. Hierarchies model 1:N relationships between tables, such as a master-detail relationship between Customers, Orders, and Items. A rowset hierarchy can be stored persistently in a data source or computed by a command. In this chapter we discuss only computed hierarchies.
Chapters are identifiers of groups of details within a rowset. These chapters work as distinct collections with a beginning and an end, but also share the facilities, such as accessors and notifications, of the rowset to which they belong.
The following example illustrates how a computed hierarchy is generated. The database schema contains the following three tables.
The following extended SQL command generates a rowset hierarchy. The syntax of this query is used only for illustration purposes. Providers may use other syntaxes to generate hierarchy.
(quantity * unit_price) AS ext_price
WHERE order_item_table.ord_no = order_table.ord_no
WHERE order_table.cust_no = customer_table.cust_no