PCHomepage
Programmer
Amazon.com, in their infinite wisdom, creates seller database dumps that have details for each transaction in separate rows and, while I know SQL well, I am a bit stumped on how to get started on a query to re-insert them in a usable way into another table in a single row. I noticed that the actual text changed somewhat over time but the basic structure remained the same with data like this:
and is grouped by the Order ID column which is what separates one order from another. I want to take this data, run a query on it, and have the end results be on one single line for each order and in specific fields in the target table. I won't be using every column of data here and others might be combined into single columns but that's another issue that I am sure I can do myself.
Can anyone suggest how to begin? Thanks in advance!
Don P
Date Order ID SKU Transaction type Payment Type Payment Detail Amount Quantity Product Title
2/13/10 103-1058945-1140208 00-AAAA-BBBB Order Payment Product charges $29.99 1 Book Name
2/13/10 103-1058945-1140208 00-AAAA-BBBB Order Payment Amazon fees Commission $-4.50 Book Name
2/13/10 103-1058945-1140208 00-AAAA-BBBB Order Payment Amazon fees Fixed closing fee $-0.99 Book Name
2/13/10 103-1058945-1140208 00-AAAA-BBBB Order Payment Amazon fees Variable closing fee $-0.80 Book Name
2/13/10 103-1058945-1140208 00-AAAA-BBBB Order Payment Other Shipping $2.98 Book Name
and is grouped by the Order ID column which is what separates one order from another. I want to take this data, run a query on it, and have the end results be on one single line for each order and in specific fields in the target table. I won't be using every column of data here and others might be combined into single columns but that's another issue that I am sure I can do myself.
Can anyone suggest how to begin? Thanks in advance!
Don P