retrieve the relations ordered in postgres

Viewed 32

Is there a way to retrieve sorted relationships without any extra scalar fields in tables in Postgres db? for example, I have a user and photo table(like below):

model photo {
      id       Int    @id @default(autoincrement())
      user_id  Int
      user     user   @relation("user_photo", fields: [user_id], references: [id])
      original String
      p320     String
      }

in which the photos are related to the user, photos connect orderly to the user, Is there a way to get them by the order that they connect?

0 Answers
Related