Results 1 to 2 of 2

Thread: Nested Tables

  1. #1
    Join Date
    Sep 2004
    Posts
    6

    Unanswered: Nested Tables

    Hi.
    Just have a quick question. Suppose in a relation we have 10 tuples and in each tuple contain a nested table. Say we wanted to get the sum of
    'X value' in each tuple of the nested table as well as the sum of 'Y value' in the main relation. So would the query below work? I'm not too sure if calling the sum of X in the nested table to cause the sum of Y in the main relation to execute multiple times. That is for example 1 tuple has a nested table that has 10 tuples, so would the query cause the sum of the main tuple to multiply by 10?

    select sum(a.Y), sum(n.X)
    from Relation a, table(a.nested) n
    group by a.someVariable

    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    I'm not sure - why don't you try it and see?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •