Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-10-07 : 14:24:21
|
| I'm trying to display the the prod_cat and the item_number for the records in the monthlyspecials table. However, it pulls more records then I want. monthlyspecials table only has 30 records.How can i return just those records and get its prod_cat from the other table? Here is my query.SELECT OELINHST_SQL.Prod_Cat, monthlyspecials.item_numberFROM monthlyspecials LEFT OUTER JOINOELINHST_SQL ON monthlyspecials.item_number = OELINHST_SQL.Item_No |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-10-07 : 14:29:12
|
| SELECT o.Prod_Cat, m.item_numberFROM monthlyspecials mINNER JOIN OELINHST_SQL oON m.item_number = o.Item_NoTara |
 |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2004-10-07 : 14:29:39
|
| If you're returning more records than are in your monthlyspecials table, some or all items must belong to more than one category.Mark |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-10-07 : 14:48:18
|
| That was the problem, there are duplicates in OELINHST_SQL. Thats line history file, so I can't do anything about that. There is another table I should be using.Thank you! |
 |
|
|
|
|
|