-
How to get last price of product?
HI,
I've classic Order table and order_details table.
How can retrieve last price of each product?
The result can be like this:
ProductCode | LastPrice
------------ | ---------
Cod1 | 10.25
Cod2 | 23.56
Cod3 | 12.23
...
....
Is possible get this result via ONE storedprocedure?
thanks,
sfvaleriano
-
What do you have in product details table, is price is that table too?
It is a two step process, can be done in a subquery.
First get last sell date (max(date)) from order detaills table by grouping product details on productid, join the result with product details to get the sell price, with join on date.
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
|
|