I am trying to merge several rows with the same "OrderNumber". An order have several rows with different data records. Each time step is saved in one record, as you can see in the image below.
Now I would like to summarize the time information for the respective "OrderNumber"s. So it should look like this:
I was wondering how to make this with an SQL query..
CodePudding user response:
Use GROUP BY
with following query:
SELECT
OrderNumber,
MAX(DateOfReceipt),
MAX(ShippingDate),
MAX(ControlDate),
MAX(DeliveryDate)
FROM
Table
GROUP BY
OrderNumber