I have two tables. One with orders and one with lines items for the orders. The line items have a unique code that relates to the line item number. When sorting on this unique code, you are able to see the order in which the item was added to the order. I'd like a query to return an actual line number instead of this unique code. Here's the layout
Order Table (orders):
orderNumber
Line Item Table (orderLines):
orderNumber
lineItem
partNumber
Example Query:
select orderNumber, lineItem, partNumber
FROM orders INNER JOIN
orderLines ON orders.csono = orderLines.csono
Example Data:
orderNumber, lineItem, partNumber
12345, _1LK0LSRTJ, part123
12345, _1LK0LSXU7, part456
12345, _1LK0LT39X, part789
I would like the results to look like this
12345-1, part123
12345-2, part456
12345-3, part789
Thank you for any help.