i need a query to get a collection ...
Following is the situation.
ive got a collection in which item of each element is different.
but each element has an item_id tat can be same.all these elements have weightage... i need to get elements with unique item_id and max weightage.
ie;
i got a collection of elements such as
e1 with item_id as 1 and weightage 7
e2 with item_id as 2 and weightage 10
e3 with item_id as 1 and weightage 8
e4 with item_id as 5 and weightage 10
e5 with item_id as 6 and weightage 10
e6 with item_id as 1 and weightage 6
so my result collection should contain the elements
e3 with item_id as 1 and weightage 8
e2 with item_id as 2 and weightage 10
e4 with item_id as 5 and weightage 10
e5 with item_id as 6 and weightage 10
can i get this in a single sql query? please help
Following is the situation.
ive got a collection in which item of each element is different.
but each element has an item_id tat can be same.all these elements have weightage... i need to get elements with unique item_id and max weightage.
ie;
i got a collection of elements such as
e1 with item_id as 1 and weightage 7
e2 with item_id as 2 and weightage 10
e3 with item_id as 1 and weightage 8
e4 with item_id as 5 and weightage 10
e5 with item_id as 6 and weightage 10
e6 with item_id as 1 and weightage 6
so my result collection should contain the elements
e3 with item_id as 1 and weightage 8
e2 with item_id as 2 and weightage 10
e4 with item_id as 5 and weightage 10
e5 with item_id as 6 and weightage 10
can i get this in a single sql query? please help
Comment