sql - display price from two tables without eliminate products -


itemprop = "text">

I have this query:

  select ITEMNAME, FrgnName, onhand, value as Regular_Price ITM1, OITM where  
<(where oitm.ItemCode = oscn.ItemCode and itm1.ItemCode = oscn.ItemCode and oscn.CardCode = 'test' and select itm1.PriceList = 2) P> This question is for a certain customer to get all the products related to the regular price (7 products).
Now I would like to add the fourth table (specialial_presses table) containing only 6 products of this customer's special price.
The problem is that if I add a special_computer to the query, then my result will be 6 products and I want to show all customer items with both prices, though one of them is 0.

I think your query can be written in SQL92 syntax this way :

  select i.ItemName, FrgnName, o.OnHand, i.Price from ITM1 I join the inner at OITM o i.ItemCode = o.ItemCode on Inner OSCN OS O.ItemCode = os.ItemCode where O.CardCode = 'test' and i.priceList = 2  

to add the 4th table that you want to add a left so that all records are shown Even if there are no results 4 table:

 o.ItemCode on  Selection i.ItemName, FrgnName, o.OnHand, i.Price from ITM1 I join the inner OITM o on i.ItemCode = o.ItemCode joining the inclusion OSCN OS = Os.ItemCode oi.tem = sp.ItemCode Special_price has been added to spam - or whatever column combines with special_pres where o.card code = 'test' and i.priceList = 2  

Comments