Skip to content
Advertisement

Tag: sql-order-by

subquery shows more that one row group by

I am trying to get the data for the best 5 customers in a railway reservation system. To get that, I tried getting the max value by summing up their fare every time they make a reservation. Here is the code. this throws the error:[21000][1242] Subquery returns more than 1 row If I remove the group by from the subquery

How to get next item in mysql order by createdAt

My frontend app can list of my items order by createdAt (for sure by calling API): Output is for example: Id of each item is UUID (there in example just myId*). I can open detail of item by url /item/detail/myIdPPP and on this detail I have GO TO NEXT item. The problem is, that I don`t know how to create

Advertisement