Thanks for your thoughts. There is a one-to-many relationship between the SecurityMaster and the Trades table(the Trades table being the many). But what the query seems to be doing is relating the two Trades tables to one another and I can't see how that should be given that the Trades tables...
I am trying to avoid multiple queries / putting data into temp tables and so am trying to write a query that will do two different sums off of the same table in one query.
select
s.name,
sum(t1.Quantity),
sum(t2.Quantity)
from
SecurityMaster s
inner join Trades t1 on s.SecurityID =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.