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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Mapping Item prices then selecting cheapest

Author  Topic 

ricc
Starting Member

16 Posts

Posted - 2011-07-14 : 03:57:40
Hi, I have the following two tables:

******
ITEMS
******
ItemID__Price
A_____5
B_____6
C_____7

******
MAPPING
******
MappingID__MasterItemID__MappedItemID
1_________A_____________B


I now want to write a query that returns the two lowest priced items: eg A and C (as A is mapped to B)??

Any pointers would be great!
Thanks
Ric

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-07-14 : 04:12:11
how is the mapping like ? will you have A mapped to B and B mapped to D and D mapped to G for example ?

Please post more sample data and the corresponding expected result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -