Multiply record fields with same mainID.

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

Hi everybody,

What's the most efficient way to get the following result:

I have a number of records with a MainID and a Value fields.

eg:

SubID MainID Value
1 1 1
2 1 1
3 1 2
4 1 3
5 2 1
6 2 1
7 3 2
8 3 2

I need the product of the Value field for each MainID.

The result has to be like this:

MainID PrValue
1 6 (1*1*2*3)
2 1 (1*1)
3 4 (2*2)

TIA,

Martin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top