How to SUM and SUBTRACT using SQL?

前端 未结 6 1449
甜味超标
甜味超标 2020-12-09 08:09

I am using MySQL and I have two tables:

master_table

  • ORDERNO
  • ITEM
  • QTY

stock_bal

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 08:26

    An example for subtraction is given below:

    Select value1 - (select value2 from AnyTable1) from AnyTable2
    

    value1 & value2 can be count,sum,average output etc. But the values should be comapatible

提交回复
热议问题