Re: How to use T-SQL to copy data between tables
Bob Horrobin <[email protected]> Tue, 14 Nov 2006 19:56:31 +0000
| Newsgroups | gmane.comp.db.mysql.windows |
|---|---|
| Message-ID | <[email protected]> |
You are trying to do a cross tab function. This could give you all sorts of problems if your orders have more than ten products. I Assume that you can only have one invoice per order. First job is to validate the data and resolve any issues there. If this is a one off I would drop it into something like Excel that has cross tab capability (pivot tables) then, if you must, load it into your table from there. If you need to repeat this frequently you need to write a stored procedure that will read your two existing tables joining on order number and sorted to invoice number. You can then construct each row for your new table on change of order number. Good luck -- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/[email protected]