How to groupBy and make a filter in one of the attributes

  Kiến thức lập trình

I want to use the groupBy funtionality of prisma to take the rows and always get that one with the higher date. For example I have this in the table:

name lastname birthDate
‘jhon’ ‘doe ’11-11-1911′
‘jhon’ ‘doe ’11-11-1951′

I want as result:

{
  name: jhon
  lastname: doe
  birthDate: 11-11-1951
}

It’s that posible?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT