G
Guest
I am working on a database with a structure similar to an order entry database.
I need help writing a SQL statement analogous to one that will generate
output that lists each order only once, and with each order only the product
from that order that is the most expensive.
For example:
I have constructed a query that will pull together data to look like this:
OrderID ProdID ProdPrice
1 5 10
1 6 12
1 9 7
2 5 10
2 13 25
3 3 5
3 10 10
3 12 8
How do I contsruct a SQL statement to generate this result?
OrderID ProdID ProdPrice
1 6 12
2 13 25
3 10 10
Thanks in advance for help with this.
CM
I need help writing a SQL statement analogous to one that will generate
output that lists each order only once, and with each order only the product
from that order that is the most expensive.
For example:
I have constructed a query that will pull together data to look like this:
OrderID ProdID ProdPrice
1 5 10
1 6 12
1 9 7
2 5 10
2 13 25
3 3 5
3 10 10
3 12 8
How do I contsruct a SQL statement to generate this result?
OrderID ProdID ProdPrice
1 6 12
2 13 25
3 10 10
Thanks in advance for help with this.
CM