Re: Strange join results

2004-10-11 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Ville Mattila <[EMAIL PROTECTED]> writes: > When I try to find out the current amount of products in our stock, > and ordered quantities I use this query: > SELECT p.id, SUM(out.quantity) ordered_out, SUM(in.quantity) > ordered_in FROM products p LEFT JOIN outorde

Strange join results

2004-10-10 Thread Ville Mattila
Hi there! I have three tables: 1. Products - id - name 2. OutOrders (orders from customers to us) - id - productid - quantity 3. InOrders (our ourders to the traders) - id - productid - quantity When I try to find out the current amount of products in our sto