All individual subscriptions are 50% off this week only!

pordonez
6 months ago

Laravel distinct query

Posted 6 months ago by pordonez

I have the following data

item 1 - 5
item 2 - 7
item 3 - 4
item 1 - 4
item 2 - 20

what query do i need to do to display this kind of result

item 1 - 5
item 2 - 20
item 3 - 4

names should be distinct and get the highest value.

Please sign in or create an account to participate in this conversation.