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

python 3.x - Mapping specific letters onto a list of words -

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -