Hi all,
I've been searching for the way to do it. I need to show the order details in a sigle row per product. I want to get the results formated as:
orderproductid orderproductunits orderproductprice orderdate
101102 6 40,35 19/10/2007
100100 3 34,68 20/10/1007
101208 4 44,78 11/10/2007
I'm having troubles because there is more than one row for productid getting the result:
orderproductid orderproductunits orderproductprice orderdate
101102 6 40,35 19/10/2007
100100 3 34,68 20/10/1007
101102 1 40,35 11/10/2007
101102 6 40,35 21/10/2007
100100 1 34,68 11/10/1007
And In this example the output that I want to show is :
orderproductid orderproductunits orderproductprice orderdate
100100 3 34,68 20/10/1007
101102 6 40,35 21/10/2007
I'm assuming that the problem is that the fields orderdate,orderproductunits and orderproductprice can get diferent values and the agregate expresion MAX(orderdate) is not agregating the right rows because all rows are diferent. Isn't Right?
How is the best aproach?
And sorry for the newbye question.
I've been searching for the way to do it. I need to show the order details in a sigle row per product. I want to get the results formated as:
orderproductid orderproductunits orderproductprice orderdate
101102 6 40,35 19/10/2007
100100 3 34,68 20/10/1007
101208 4 44,78 11/10/2007
I'm having troubles because there is more than one row for productid getting the result:
orderproductid orderproductunits orderproductprice orderdate
101102 6 40,35 19/10/2007
100100 3 34,68 20/10/1007
101102 1 40,35 11/10/2007
101102 6 40,35 21/10/2007
100100 1 34,68 11/10/1007
And In this example the output that I want to show is :
orderproductid orderproductunits orderproductprice orderdate
100100 3 34,68 20/10/1007
101102 6 40,35 21/10/2007
I'm assuming that the problem is that the fields orderdate,orderproductunits and orderproductprice can get diferent values and the agregate expresion MAX(orderdate) is not agregating the right rows because all rows are diferent. Isn't Right?
How is the best aproach?
And sorry for the newbye question.