This is my sql code
SELECT qty, unitprice, qty * unitprice as Stock FROM item
Form this i want to get the SUM of Stock
It is not clear what you are asking here. I'm not sure about the ultimate goal you are trying to achieve, but this will bring you SUM of all qty * unitprice :
SELECT qty, unitprice, SUM(qty * unitprice) as Stock FROM item
And this is literally bring you SUM of Stock :
SELECT SUM(Stock) as SUM_OF_STOCK
FROM
(SELECT qty, unitprice, qty * unitprice as Stock
FROM item)
If none of above query fit your needs, I think you really need to edit the question and elaborate more on what you are trying achieve.
SUM(qty*unitprice)by usinggroup by.SELECT SUM(qty*unitprice) as stock FROM item.