Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    Southern California
    Posts
    35

    Question Unanswered: Assigning a Text Variable or Other Method

    Here's what I've got:

    select sum(item_price) as item_price, sum(item_qty) as item_qty, avg (item_price) / avg(item_qty) as average_price from x_invoic

    where item_code = (item from a different table)
    and status = 9

    The "item from a different table" are items that I'm interesting in compiling this data for. I'm not sure what the best way to "cycle" through these items is but I would like to get data on each one of them. I was thinking of using a variable, if possible, but I'll do whatever works.

    Any input is appreciated.

    Regards,
    TechRick
    Last edited by techrick; 04-30-03 at 21:04.

  2. #2
    Join Date
    Apr 2003
    Posts
    30
    Use IN and GROUP BY

  3. #3
    Join Date
    Aug 2002
    Location
    Southern California
    Posts
    35

    Talking

    Originally posted by jzhu
    Use IN and GROUP BY
    Thanks!

Posting Permissions

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