Sorry the expected result should look like this:
table_c (Expected Result)
outlet_category_6 item_code table_a_item_description table_b_item_description table_a_quantity table_a_quantity
---------------------- ------------ --------------------------
ODV Restaurant A001 Coke Coke 10 11
ODV Restaurant A002 Sprite Sprite 10 11
ODV Restaurant A003 Fanta NULL 10 NULL
ODV Restaurant A004 NULL Coke Light NULL 11
Corner Restaurant A001 Coke Coke 10 11
Corner Restaurant A003 Fanta NULL 10 NULL
Corner Restaurant A004 Coke Light Coke 10 11
Main Topics
Browse All Topics





by: angelIIIPosted on 2007-01-11 at 23:20:26ID: 18299489
select * from table_a a join table_b b on a.item_code = b.item_code and a.outlet_category_6 = b.outlet_category_6
now, I assume that in table_b you only forgot 1 row or had 1 rows too much in the sample expected output?