select x.ProductName, sum(x.field1+y.field2) as Mysum, y.field2 from tablexxx as x inner join tableyyy as y on x.id =y.id where as Mysum - y.field2 > 0
obviously it doesnt work!, but I'm looking for suggestions
select x.ProductName, sum(x.field1+y.field2) as Mysum, y.field2 from tablexxx as x inner join tableyyy as y on x.id =y.id where as Mysum - y.field2 > 0
obviously it doesnt work!, but I'm looking for suggestions
Select ProductName, MySum, field2
From (Select x.ProductName, SUM(x.field1 + y.field2) as MySum, y.field2
From tablexxx as x inner join
tableyyy as y on x.id = y.id) as q
Where MySum - field2 > 0
select x.ProductName, sum(x.field1+y.field2) as Mysum, y.field2 from tablexxx as x inner join tableyyy as y on x.id =y.id where as Mysum - y.field2 > 0
obviously it doesnt work!, but I'm looking for suggestions