Wednesday, March 28, 2012

how to get the sum of the fields ...Very URGENT

hi .. iam having a table with six fields which is holding some values.
there are two branches for a company. now they want to see the two branches values at once . that is sum of the stockin,
sum of the stock out etc...

my table is here...
stockin
stockout
stockinhand
openingstock
unitrate
value.

Now i want to get the sum of these two brancheshi,

in ur table there is no feilds to specify the branch like branch id like that.
if there is baranch id then the query is like this.....

select sum(stockin) as stockinn,sum(stockout) as stockoutt from stack where branchid=1

othere wise can u send me how u identify two differnt branches.

No comments:

Post a Comment