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

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -