query in sqlite with few condition

  • Thread starter Thread starter AC Question
  • Start date Start date
A

AC Question

I want to select column 1 with the condition A and its values to be combined. Also, column 2 will be selected with the condition B and its values will be added. Finally, the answer to column 1 is reduced from column 2.

//example columns: id------number------work------baskets

row1=100/buy/1 ***row2=800/buy/1 ***row3=500/sale/1 ***row4=600/buy/2 ***row5=400/sale/2

restNumber(for baskets 1) = (600) - 400 = 200 restNumber(for baskets 2) = (100 + 800) - 500 = 400
 

Trending Posts

Forum statistics

Threads
956,764
Messages
6,969,929
Members
3,163,612
Latest member
Clout