select - MySQL multiple left join group by -


There is something wrong with this MySQL code. If this is returning more stocks, then it should be.

The table positions are available in stock (a product at multiple positions) The table ordering order holds the ordering product (1 order holder for many orders)

  SELECT PRO .ProductID, PRO.ProductCode, SUM (POS.Qty) AS instock, SUM (OB.Qty) AS P.P.I.I. Order ob ob ProductID = Pro. Productive WEEER POS ProductID = OB Producted Group by Prof. Product ID, POS Product ID, OB  

Number of Posts = 2 (max.)

  • 20 each)
  • onorder = 16 volume

  • serial number = 8 rows
  • Actually order = 8 ( Qty = 1) with each

    This is one of the products

    I know that this is something to do with the group, but I can not work it .

    Appreciate any help.

    A few days ago I had the same problem. Try this by choosing from a different query: SELECT ..., from products (SELECT ...) ... "where you have two tables left. Try to test the first sub-query, and try After doing OT work, keep it together. (Once you have the data you want, and do not duplicate, because this is the problem.

  • Comments

    Popular posts from this blog

    mysql - BLOB/TEXT column 'value' used in key specification without a key length -

    c# - Using Vici cool Storage with monodroid -

    python - referencing a variable in another function? -