Hi Folks,
I would like to produce a rowset where one column
contains the count of rows within a collection.
Here are some sample tables to demonstrate the situation.
CUST_TABLE
custiD
C1
C2
C3
ORDER_TABLE
orderID custID
101 C1
122 C2
133 C3
139 C3
ITEMS-TABLE
orderID amount
101 $30
122 $93
122 $54
133 $16
133 $74
133 $12
139 $88
-------------------------------------
DESIRED_ROWSET
custID orderID amount row_count
C1 101 $30 1
C2 122 $93 2
C2 122 $54 2
C3 133 $16 3
C3 133 $74 3
C3 133 $12 3
C3 139 $88 1
-------------------------------------
The row_count column contains the number and rows
in the order (within the custId) eg: OrderID #133 has 3 rows.
I know it's not normalized, but the report layout portion
of the code is made HUGELY easier if I can determine
how many rows there are at the start of each order.
Any help welcome.
Thanks V.Much.
Milton.
I would like to produce a rowset where one column
contains the count of rows within a collection.
Here are some sample tables to demonstrate the situation.
CUST_TABLE
custiD
C1
C2
C3
ORDER_TABLE
orderID custID
101 C1
122 C2
133 C3
139 C3
ITEMS-TABLE
orderID amount
101 $30
122 $93
122 $54
133 $16
133 $74
133 $12
139 $88
-------------------------------------
DESIRED_ROWSET
custID orderID amount row_count
C1 101 $30 1
C2 122 $93 2
C2 122 $54 2
C3 133 $16 3
C3 133 $74 3
C3 133 $12 3
C3 139 $88 1
-------------------------------------
The row_count column contains the number and rows
in the order (within the custId) eg: OrderID #133 has 3 rows.
I know it's not normalized, but the report layout portion
of the code is made HUGELY easier if I can determine
how many rows there are at the start of each order.
Any help welcome.
Thanks V.Much.
Milton.