Re: Query with multiple tables

patrick.sparks_at_gmail.com
Date: 10/20/04

  • Next message: patrick.sparks_at_gmail.com: "Re: Query with multiple tables"
    Date: 19 Oct 2004 19:03:42 -0700
    
    

    That query is much too complicated for what you're trying to do. Try
    this:

    SELECT
    t1.item
    , t1.description
    , t2.location
    , t2.qty_on_hand AS qty_on_hand
    , SUM(t3.sales) AS ytd_sales
    FROM t1
    INNER JOIN t2 ON t1.item = t2.item
    INNER JOIN t3 ON t2.item = t3.item AND t2.location = t3.location
    GROUP BY
    t1.item
      , t1.description
      , t2.location
      , t2.qty_on_hand


  • Next message: patrick.sparks_at_gmail.com: "Re: Query with multiple tables"
    Loading