|
-
May 4th, 2011, 04:18 AM
#1
Thread Starter
Addicted Member
[T-SQL] Help with LastBuy price of an item
I have these tables:
Item:
Name | SellPrice
---------------------
A | 100
B | 200
C | 300
And a table of buyitem details
ItemName | BuyPrice | Date
------------------------------
A | 50 | 1-1-2011
A | 75 | 1-2-2011
B | 150 | 1-1-2011
B | 125 | 1-5-2011
C | 270 | 1-1-2011
C | 260 | 2-8-2011
How can I know each item last buy price? So I can make a table like this:
Name | SellPrice | Last Buy Price
--------------------------------
A | 100 | 75
B | 200 | 125
C | 300 | 260
I don't have any idea on how to make the queries for this result. I hope someone can help me..
Thanks before..
-
May 6th, 2011, 11:37 PM
#2
Thread Starter
Addicted Member
Re: [T-SQL] Help with LastBuy price of an item
Still stuck at this problem. Is there anyone who can give me a solution?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|