SCJP, SCWCD, SCBCD, SCEA 5
SCJP, SCWCD, SCBCD, SCEA 5
Mohamed Farouk wrote:Required SQL Group the orders according to date for with max amount for each date
No more Blub for me, thank you, Vicar.
SCJP, SCWCD, SCBCD, SCEA 5
Looks like a simple order by date,customer_id would work to me.
SCJP, SCWCD, SCBCD, SCEA 5
Mohamed Farouk wrote:What will be the SQL to to get the below answer
date customer_id order_id amount
1/1/2013 1 1 1500
1/1/2013 2 2 1500
3/1/2013 1 1 1000
4/1/2013 1 1 1000
Mohamed Farouk wrote:OK Sorry I apologize English is not my first language!
Let me put it like this in numbers
Order Table
date customer_id order_id amount
1/1/2013 1 1 1500
1/1/2013 2 2 1500
3/1/2013 1 1 1000
4/1/2013 3 1 700
4/1/2013 1 1 1000
What will be the SQL to to get the below answer
date customer_id order_id amount
1/1/2013 1 1 1500
1/1/2013 2 2 1500
3/1/2013 1 1 1000
4/1/2013 1 1 1000
Let me be clear i tried and I failed cant get it, lets see what you guys come up with!
SCJP, SCWCD, SCBCD, SCEA 5
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |