SQL Join Problems -


i'm having problem assume related join in sql statement.

select s.customer 'customer',      s.store 'store',      s.item 'item',      d.dlvry_dt 'delivery',      i.item_description 'description',      mj.major_class_description 'major description',      s.last_physical_inventory_dt 'last physical date',      s.qty_physical 'physical qty',      s.avg_unit_cost 'unit cost',      [qty_physical]*[avg_unit_cost] value  argus.delivery d  join argus.store_inventory s      on (s.store = d.store) join argus.item_master      on (s.item = i.item) join argus.minor_item_class mi      on (i.minor_item_class = mi.minor_item_class) join argus.major_item_class mj      on (mi.major_item_class = mj.major_item_class) s.last_physical_inventory_dt between '6/29/2011' , '7/2/2012'      , s.customer = '20001'      , s.last_physical_inventory_dt not null 

it comes seemingly infinite amount of copies of 1 record. there wrong way i'm joining these tables?

join argus.minor_item_class mi      on (i.minor_item_class = mi.minor_item_class) join argus.major_item_class mj      on (mi.major_item_class = mj.major_item_class) 

my guess error resides in 1 of these 2 joins. when use word join assumes trying inner join returns records have @ least 1 1. don't know data looks assuming there many many relationship between minor item class , major item class when run query receiving duplicated records every field, major item class differs.

i @ results. of columns have repeating data doesn't change while 1 of columns have different value every row. should tell column differing data each row column should joining differently.

otherwise, query formatted correctly.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -