I have a table with waybill_items orders, in which waybill is the order number and name is the name. On one order can go several items.
How can I make a selection by the last order (he, it turns out, the maximum waybill value) of all items?
If I use the normal MAX function, then it gives only one line from the name, and I have about 20 of them.
SELECT MAX(waybill), name FROM waybill_items