Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    London, England
    Posts
    106

    Unanswered: SELECT PRODUCT(Volume) FROM table???

    Is it possible to select the product of numbers in a table, sort of like the SUM-aggregator? Say I have the table like this:

    Volume
    -----------
    3
    2
    3

    Can I somehow do a simple select and get 18 (3x2x3)?
    Frettmaestro
    "Real programmers don't document, if it was hard to write it should be hard to understand!"

  2. #2
    Join Date
    Dec 2002
    Location
    Czech Republic
    Posts
    249
    declare @product int
    set @product=1
    select @product=@product*x from (select x=2 union all select 3 union all select 4) x
    select @product

Posting Permissions

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