请问oracle高手 SQL语句该如何修改,怎么写。急!!!
后台为ORACEL数据库:
select A.SORDER,A.KOTECD,A.JSTSTM,A.JSTETM,B.WAREHUSFG,B.WAREETM,
from factv2.SAGPLNFL A,FACTV2.SGPROGSS B
Where B.WAREHUSFG=1(1为入库标志)
AND A.SORDER=B.SORDER
ORDER BY A.SORDER
(说明:SORDER为表单号 KOTECD为工序号 JSTSTM为工序开始时间,JSTETM为工序结束时间。WAREHUSFG入库状态,WAREETM入库时间)
得到以下数据:
SORDER KOTECED JSTSTM JSTETM WAREHUSFG WAREETM
03103410 1015 2008-12-31 13:58:00 2008-12-31 13:58:00 1 2009-01-06 06:15:00
03103410 2015 2008-12-31 13:58:00 2008-12-31 13:58:00 1 2009-01-06 06:15:00
03103410 2025 2008-12-31 18:36:00 2008-12-31 20:40:00 1 2009-01-06 06:15:00
03103410 2026 2008-12-31 20:44:00 2008-12-31 20:45:00 1 2009-01-06 06:15:00
03103410 2030 2008-12-31 23:29:00 2008-12-31 23:29:00 1 2009-01-06 06:15:00
03103410 2036 2009-01-01 05:32:00 2009-01-01 07:23:00 1 2009-01-06 06:15:00
03103410 2040 2009-01-02 15:04:00 2009-01-02 15:04:00 1 2009-01-06 06:15:00
03103410 2054 2009-01-02 23:02:00 2009-01-02 23:02:00 1 2009-01-06 06:15:00
03103410 2070 2009-01-03 04:55:00 2009-01-03 04:55:00 1 2009-01-06 06:15:00
03103410 2075 2009-01-03 05:28:00 2009-01-03 05:28:00 1 2009-01-06 06:15:00
03103410 2080 2009-01-03 15:08:00 2009-01-03 15:08:00 1 2009-01-06 06:15:00
03103410 2090 2009-01-05 05:53:00 2009-01-05 05:53:00 1 2009-01-06 06:15:00
03103410 2095 2009-01-05 06:15:00 2009-01-05 06:15:00 1 2009-01-06 06:15:00
03103410 3000 null null 1 2009-01-06 06:15:00
03103420 1015 2008-12-31 13:58:00 2008-12-31 13:58:00 1 2009-01-06 11:18:00
03103420 2015 2008-12-31 13:58:00 2008-12-31 15:30:00 1 2009-01-06 11:18:00
03103420 2025 2008-12-31 20:41:00 2008-12-31 22:01:00 1 2009-01-06 11:18:00
03103420 2026 2008-12-31 22:18:00 2008-12-31 22:18:00 1 2009-01-06 11:18:00
03103420 2030 2009-01-01 01:34:00 2009-01-01 01:34:00 1 2009-01-06 11:18:00
03103420 2036 2009-01-01 05:32:00 2009-01-01 07:23:00 1 2009-01-06 11:18:00
03103420 2040 2009-01-02 13:36:00 2009-01-02 13:37:00 1 2009-01-06 11:18:00
03103420 2054 2009-01-02 23:01:00 2009-01-02 23:01:00 1 2009-01-06 11:18:00
03103420 2070 2009-01-03 12:35:00 2009-01-03 12:35:00 1 2009-01-06 11:18:00
03103420 2075 2009-01-03 13:48:00 2009-01-03 13:48:00 1 2009-01-06 11:18:00
03103420 2080 2009-01-03 15:09:00 2009-01-03 15:09:00 1 2009-01-06 11:18:00
03103420 2090 2009-01-05 08:53:00 2009-01-05 08:53:00 1 2009-01-06 11:18:00
03103420 2095 2009-01-05 11:17:00 2009-01-05 11:18:00 1 2009-01-06 11:18:00
03103420 3000 null null 1 2009-01-06 11:18:00
03103430 1015 2008-12-31 12:56:00 2008-12-31 12:56:00 1 2009-01-06 11:18:00
03103430 2015 2008-12-31 12:56:00 2008-12-31 18:09:00 1 2009-01-06 11:18:00
03103430 2025 2008-12-31 22:02:00 2008-12-31 23:29:00 1 2009-01-06 11:18:00
03103430 2026 2008-12-31 23:36:00 2008-12-31 23:36:00 1 2009-01-06 11:18:00
03103430 2030 2009-01-01 03:16:00 2009-01-01 03:16:00 1 2009-01-06 11:18:00
03103430 2036 2009-01-01 05:32:00 2009-01-01 07:23:00 1 2009-01-06 11:18:00
03103430 2040 2009-01-02 15:41:00 2009-01-02 15:41:00 1 2009-01-06 11:18:00
03103430 2054 2009-01-03 01:45:00 2009-01-03 01:45:00 1 2009-01-06 11:18:00
03103430 2070 2009-01-03 11:51:00 2009-01-03 11:52:00 1 2009-01-06 11:18:00
03103430 2075 2009-01-03 11:52:00 2009-01-03 11:52:00 1 2009-01-06 11:18:00
03103430 2080 2009-01-03 15:08:00 2009-01-03 15:08:00 1 2009-01-06 11:18:00
03103430 2090 2009-01-05 10:06:00 2009-01-05 10:06:00 1 2009-01-06 11:18:00
03103430 2095 2009-01-05 11:17:00 2009-01-05 11:17:00 1 2009-01-