SQL 数据处理问题
ID start end flag
A1 2013-01-23 13:22:27.657 2013-01-23 13:23:04.037 0 *
A1 2013-01-23 13:23:04.037 2013-01-23 14:16:41.823 1 *
A1 2013-01-23 14:16:41.823 2013-01-23 14:17:01.343 0
A1 2013-01-23 14:17:01.343 2013-01-23 14:17:20.050 0
A1 2013-01-23 14:17:20.050 2013-01-23 14:17:41.440 0
A1 2013-01-23 14:17:41.440 2013-01-23 14:18:05.310 0
A1 2013-01-23 14:18:05.310 2013-01-23 14:19:17.817 0
A1 2013-01-23 14:19:17.817 2013-01-23 14:23:42.447 0
A1 2013-01-23 14:23:42.447 2013-01-23 14:24:05.357 0
A1 2013-01-23 14:24:05.357 2013-01-23 14:24:42.513 0
A1 2013-01-23 14:24:42.513 2013-01-23 14:25:22.530 0
A1 2013-01-23 14:25:22.530 2013-01-23 14:25:43.800 0
A1 2013-01-23 14:25:43.800 2013-01-23 14:26:10.577 0
A1 2013-01-23 14:26:10.577 2013-01-23 14:28:56.297 0
A1 2013-01-23 14:28:56.297 2013-01-23 14:31:27.773 0
A1 2013-01-23 14:31:27.773 2013-01-23 14:31:43.770 0
A1 2013-01-23 14:31:43.770 2013-01-23 14:36:19.967 0
A1 2013-01-23 14:36:19.967 2013-01-23 14:36:32.233 0
A1 2013-01-23 14:36:32.233 2013-01-23 14:36:40.650 0
A1 2013-01-23 14:36:40.650 2013-01-23 14:37:13.967 0
A1 2013-01-23 14:37:13.967 2013-01-23 14:38:47.467 0
A1 2013-01-23 14:38:47.467 2013-01-23 14:39:33.443 0
A1 2013-01-23 14:39:33.443 2013-01-23 14:39:46.403 0
A1 2013-01-23 14:39:46.403 2013-01-23 14:40:00.190 0
A1 2013-01-23 14:40:00.190 2013-01-23 14:40:10.417 0
A1 2013-01-23 14:40:10.417 2013-01-24 17:59:01.647 1 *
A1 2013-01-24 17:59:01.647 2013-01-24 18:01:59.167 0
A1 2013-01-24 18:01:59.167 2013-01-24 18:03:54.140 0
A1 2013-01-24 18:03:54.140 NULL 0
A2 2013-01-24 18:17:07.810 2013-01-24 18:51:36.667 1 *
A2 2013-01-24 18:51:36.667 2013-01-24 18:52:46.310 0
A2 2013-01-24 18:52:46.310 2013-01-24 18:53:31.827 0
A2 2013-01-24 18:53:31.827 2013-01-24 18:53:53.370 0
A2 2013-01-24 18:53:53.370 2013-01-24 18:54:19.197 0
A2 2013-01-24 18:54:19.197 2013-01-24 18:54:49.570 0
A2 2013-01-24 18:54:49.570 2013-01-24 18:55:11.003 0
A2 2013-01-24 18:55:11.003 2013-01-24 18:55:32.030 0
A2 2013-01-24 18:55:32.030 2013-01-24 18:56:02.357 0
A2 2013-01-24 18:56:02.357 2013-01-24 18:56:22.810 0
A2 2013-01-24 18:56:22.810 2013-01-25 06:10:02.383 1 *
A2 2013-01-25 06:10:02.383 2013-01-25 08:52:32.887 1 *
A2 2013-01-25 08:52:32.887 2013-01-25 08:52:58.467 0
A2 2013-01-25 08:52:58.467 2013-01-25 08:53:47.553 0
A2 2013-01-25 08:53:47.553 NULL 0
A3 2013-01-24 18:01:03.413 2013-01-24 18:13:13.877 0 *
A3 2013-01-24 18:13:13.877 2013-01-24 18:13:29.353 0
A3 2013-01-24 18:13:29.353 2013-01-24 18:13:44.153 0
A3 2013-01-24 18:13:44.153 2013-01-24 18:14:00.027 0
A3 2013-01-24 18:14:00.027 2013-01-24 18:14:32.657 0
A3 2013-01-24 18:14:32.657 2013-01-24 18:15:08.993 0
A3 2013-01-24 18:15:08.993 2013-01-24 18:15:42.527 0
A3 2013-01-24 18:15:42.527 2013-01-24 18:16:19.963 0
A3 2013-01-24 18:16:19.963 2013-01-24 18:16:44.077 0
A3 2013-01-24 18:16:44.077 NULL 0
在上述表中,ID表示不同的通