我有一個表,即無,日期和步驟如何填寫以前的記錄和基於條件?
+---------+----------------------------+----------------------------+
| No | Date | Step |
+---------+----------------------------+----------------------------+
| 643995G | 03/12/2012 3:22:48 PM | TransferInStart |
| 643995G | 03/12/2012 3:22:50 PM | |
| 643995G | 15/02/2013 10:53:57 AM | Hold |
| 643995G | 15/02/2013 10:54:00 AM | Hold Copy Processing Start |
| 643995G | 20/02/2013 4:38:26 PM | |
| 643995G | 21/02/2013 3:27:01 PM | ExceptionStart |
| 643995G | 22/02/2013 9:38:32 AM | ExceptionEnd |
| 643995G | 22/02/2013 9:39:32 AM | |
| 643995G | 22/02/2013 10:04:53 AM | |
| 643995G | 22/02/2013 10:04:56 AM | |
| 643995G | 25/02/2013 10:48:18 AM | TransferIn |
| 643995G | 25/02/2013 10:48:19 AM | CatalougingStart |
| 643995G | 27/02/2013 1:59:44 PM | |
| 643995G | 27/02/2013 1:59:45 PM | |
| 643995G | 27/02/2013 2:05:01 PM | Catalouging |
| 643995G | 27/02/2013 2:05:02 PM | ProcessingStart |
| 643995G | 27/02/2013 6:09:51 PM | |
| 643995G | 27/02/2013 6:09:52 PM | |
| 643995G | 04/03/2013 2:03:16 PM | |
| 643995G | 04/03/2013 2:03:17 PM | Hold Copy Processing Start |
| 643995G | 11/03/2013 2:27:14 PM | |
| 643995G | 12/03/2013 10:09:55 AM | ExceptionStart |
| 643995G | 12/03/2013 10:10:27 AM | ExceptionEnd |
| 643995G | 12/03/2013 10:10:52 AM | |
| 643995G | 12/03/2013 10:11:27 AM | |
| 643995G | 12/03/2013 10:28:37 AM | |
| 643995G | 12/03/2013 10:46:21 AM | Processing |
+---------+----------------------------+----------------------------+
以下數據想填補與上一步中的空記錄。
在填寫上述值之後,我發現異常開始和異常結束想填寫上述值。
請參考吹步驟2和步驟3作爲輸出示例。
+---------+------------------------+----------------------------+----------------------------+----------------------------+
| No | Date | ProcessStep | Step2 | Step3 |
+---------+------------------------+----------------------------+----------------------------+----------------------------+
| 643995G | 03/12/2012 3:22:48 PM | TransferInStart | TransferInStart | TransferInStart |
| 643995G | 03/12/2012 3:22:50 PM | | TransferInStart | TransferInStart |
| 643995G | 15/02/2013 10:53:57 AM | Hold | Hold | Hold |
| 643995G | 15/02/2013 10:54:00 AM | Hold Copy Processing Start | Hold Copy Processing Start | Hold Copy Processing Start |
| 643995G | 20/02/2013 4:38:26 PM | | Hold Copy Processing Start | Hold Copy Processing Start |
| 643995G | 21/02/2013 3:27:01 PM | ExceptionStart | ExceptionStart | Hold Copy Processing Start |
| 643995G | 22/02/2013 9:38:32 AM | ExceptionEnd | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 22/02/2013 9:39:32 AM | | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 22/02/2013 10:04:53 AM | | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 22/02/2013 10:04:56 AM | | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 25/02/2013 10:48:18 AM | TransferIn | TransferIn | TransferIn |
| 643995G | 25/02/2013 10:48:19 AM | CatalougingStart | CatalougingStart | CatalougingStart |
| 643995G | 27/02/2013 1:59:44 PM | | CatalougingStart | CatalougingStart |
| 643995G | 27/02/2013 1:59:45 PM | | CatalougingStart | CatalougingStart |
| 643995G | 27/02/2013 2:05:01 PM | Catalouging | Catalouging | Catalouging |
| 643995G | 27/02/2013 2:05:02 PM | ProcessingStart | ProcessingStart | ProcessingStart |
| 643995G | 27/02/2013 6:09:51 PM | | ProcessingStart | ProcessingStart |
| 643995G | 27/02/2013 6:09:52 PM | | ProcessingStart | ProcessingStart |
| 643995G | 04/03/2013 2:03:16 PM | | ProcessingStart | ProcessingStart |
| 643995G | 04/03/2013 2:03:17 PM | Hold Copy Processing Start | Hold Copy Processing Start | Hold Copy Processing Start |
| 643995G | 11/03/2013 2:27:14 PM | | Hold Copy Processing Start | Hold Copy Processing Start |
| 643995G | 12/03/2013 10:09:55 AM | ExceptionStart | ExceptionStart | Hold Copy Processing Start |
| 643995G | 12/03/2013 10:10:27 AM | ExceptionEnd | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 12/03/2013 10:10:52 AM | | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 12/03/2013 10:11:27 AM | | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 12/03/2013 10:28:37 AM | | ExceptionEnd | Hold Copy Processing Start |
| 643995G | 12/03/2013 10:46:21 AM | Processing | Processing | Processing |
+---------+------------------------+----------------------------+----------------------------+----------------------------+
連接輸入表的圖像清晰
連接輸出值的圖像清晰
您使用的是什麼版本的sql-server? – mxix
@kitees,如果您的SO將會被激活,請使用這個收費來格式化您的示例數據:http://www.sensefulsolutions.com/2010/10/format-text-as-table.html – FLICKER
Hi Mxix ..我正在使用版本2008 R2。 – kitees