sql - How to subtracting-2-columns-different-tables in C# -


i have 2 tables inventory , other sales want tell how many items still in store doing have subtract quantity column of inventory table quantity column sales table 1 idea how can this

inventory                                                   sales  items quantity                                           items quantity      50                                                      30 b      70                                                 b      20 d       60                                                d       10 c       40                                                c       30 

create new table new columns answer

select (inventory.quantity - sales.quantity) leftqty inventory join sales on sales.items=inventory.items 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -