4 Replies Latest reply: Jul 1, 2014 3:50 AM by Tobias Meyer RSS

    sum() with values from another table

      Hi guys,

      how can I use a columm, which i created new from another table like this

       

      Table1: Amount,

           Date,

           If(Amount, Amount*(-1)) as NEW.Amount

       

      Table2:

      Load Amount,

           Date,

           sum(NEW.Amount) as SUM.SELL where (.X..) group by ..

       

      SQL Select Date, Amount ... FROm ...

       

      Table3:

      Load Amount,

           Date,

           sum(NEW.Amount) as SUM.BUYwhere (.Y..) group by ..

       

      SQL Select Date, Amount ... FROm ...

       

      __

      the NEW.Amount is now in the database, so how can I use it across the tables?