By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,616 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,616 IT Pros & Developers. It's quick & easy.

Multiple Group by

P: 2
Hello Guys,

I am pulling my hair on this one... and I am sure there is an easy way to solve my issue. I have a main table and 4 tables that are joined to it.

I need to get the the average value of each "area" group where all the left side values are the same using the amount on the "VALUE" table and the description of the corresponding table. (in this result example I am just writing the code value)

Result should look similar as below, considering that the VALUES table has records with a value of $1 each. Your help is greatly appreciated, as at this stage I am creating temp tables.


A1:$4, B1:$1, C1:$1
A1:$4, B2:$3, C1:$2
A1:$4, B2:$3, C2:$1
A2:$2, B3:$2, C2:$2

MAIN table values example:

'A1', 'B1', 'C1', 'V1'
'A1', 'B2', 'C1, 'V2'
'A1', 'B2', 'C1', 'V3'
'A1', 'B2', 'C2', 'V4'
'A2', 'B3', 'C1', 'V5'
'A2', 'B3', 'C1', 'V6'

MAIN table structure:
- code1
- code2
- code3
- valuecode

TABLE1 structure
- description
- code1

TABLE2 structure
- description
- code2

TABLE3 structure
- description
- code3

VALUE structure
- description
- valuecode
- amount
Aug 21 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.