I have a table like this
Fruits
-------
Apples |Oranges | Bananas
0 | 1 | 0
0 | 1 | 5
0 | 0 | 2
0 | 0 | 1
1 | 2 | 1
1 | 1 | 1
1 | 3 | 6
I need to get the row that points to the max of oranges and Bananas group by Apples.
For eg a correct sql query should give me this result
Apples |Oranges | Bananas
0 | 1 | 5
1 | 3 | 6
I am getting the max(oranges) for each Apples,but not the max(Bananas).The max(bananas) value is not grouping by Apples but the whole table.
Any suggestions how I do this.
Thanks a bunch...in advance
Fruits
-------
Apples |Oranges | Bananas
0 | 1 | 0
0 | 1 | 5
0 | 0 | 2
0 | 0 | 1
1 | 2 | 1
1 | 1 | 1
1 | 3 | 6
I need to get the row that points to the max of oranges and Bananas group by Apples.
For eg a correct sql query should give me this result
Apples |Oranges | Bananas
0 | 1 | 5
1 | 3 | 6
I am getting the max(oranges) for each Apples,but not the max(Bananas).The max(bananas) value is not grouping by Apples but the whole table.
Any suggestions how I do this.
Thanks a bunch...in advance