SELECT sum(purchaseproductquantity.ordered)as purchase,(select sum(salesprowithgst.quantity) from salesprowithgst where salesprowithgst.product=purchaseproductquantity.pname && salesprowithgst.price='10' && salesprowithgst.product='prd-1')as salesprowithgst,(select sum(salesprowithoutgst.quantity) from salesprowithoutgst where salesprowithoutgst.product=purchaseproductquantity.pname && salesprowithoutgst.price='10' && salesprowithoutgst.product='prd-1')as salesprowithoutgst ,
(select sum(salesreturnprowithgst.quantity) from salesreturnprowithgst where salesreturnprowithgst.product=purchaseproductquantity.pname && salesreturnprowithgst.price='10' && salesreturnprowithgst.product='prd-1')as salesreturnprowithgst,
(select sum(salesreturnprowithoutgst.quantity) from salesreturnprowithoutgst where salesreturnprowithoutgst.product=purchaseproductquantity.pname && salesreturnprowithoutgst.price='10' && salesreturnprowithoutgst.product='prd-1')as salesreturnprowithoutgst,(select sum(purchasereturn.quantity) from purchasereturn where purchasereturn.product=purchaseproductquantity.pname && purchasereturn.price='10'
&& purchaseproductquantity.pname='prd-1')as purchasereturn,
(sum(purchaseproductquantity.ordered)-(select sum(salesprowithgst.quantity) from salesprowithgst where salesprowithgst.product=purchaseproductquantity.pname && salesprowithgst.price='10' && salesprowithgst.product='prd-1')-(select sum(salesprowithoutgst.quantity) from salesprowithoutgst where salesprowithoutgst.product=purchaseproductquantity.pname && salesprowithoutgst.price='10' && salesprowithoutgst.product='prd-1')+
(select sum(salesreturnprowithgst.quantity) from salesreturnprowithgst where salesreturnprowithgst.product=purchaseproductquantity.pname && salesreturnprowithgst.price='10' && salesreturnprowithgst.product='prd-1')+
(select sum(salesreturnprowithoutgst.quantity) from salesreturnprowithoutgst where salesreturnprowithoutgst.product=purchaseproductquantity.pname && salesreturnprowithoutgst.price='10' && salesreturnprowithoutgst.product='prd-1')-(select sum(purchasereturn.quantity) from purchasereturn where purchasereturn.product=purchaseproductquantity.pname && purchasereturn.price='10'
&& purchaseproductquantity.pname='prd-1'))as total
from purchaseproductquantity where purchaseproductquantity.pname='prd-1' && 
purchaseproductquantity.price='10'








ALTER TABLE table_name. DROP INDEX index_name;