I have an original table with records of orders. How can go about getting an output where my result gives me the origin of the first leg and the destination of the final leg for the same order number?
ORDER_NUMBER | LEG_NUMBER | ORIGIN | DESTINATION |
---|---|---|---|
ORD_200 | 1 | Utah | California |
ORD_200 | 2 | California | New York |
ORD_200 | 3 | New York | Pennsylvania |
Desired Output:
ORDER_NUMBER | ORIGIN | DESTINATION |
---|---|---|
ORD_200 | Utah | Pennsylvania |