|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
语句1:
select workorder.wonum,
workorder.description,
workorder.location,
workorder.assetnum,
asset.description,
locations.description,
workorder.cwo36,
workorder.cwo37,
workorder.status,
workorder.crewid,
workorder.wolo4,
workorder.statusdate,
workorder.woqw6,
workorder.wol3,
a.changeby,
a.changedate
from MAXIMO.workorder, MAXIMO.asset, MAXIMO.locations,
(select c.wonum,c.changeby,c.changedate from MAXIMO.wostatus c
where c. status=\'YZWAPPR\' and c.wostatusid = (select max(b.wostatusid) from MAXIMO.wostatus b where b.wonum=c.wonum and b.status=\'YZWAPPR\')) a
where workorder.assetnum = asset.assetnum(+)
and workorder.location = locations.location(+)
and workorder.wonum=a.wonum(+)
and 1 = 1
语句2:
select workorder.wonum,
workorder.description,
workorder.location,
workorder.assetnum,
asset.description,
locations.description,
workorder.cwo36,
workorder.cwo37,
workorder.status,
workorder.crewid,
workorder.wolo4,
workorder.statusdate,
workorder.woqw6,
workorder.wol3,
a.changeby,
a.changedate
from MAXIMO.workorder, MAXIMO.asset, MAXIMO.locations,
( select c.wonum,c.changeby,c.changedate from MAXIMO.wostatus c,
(Select wonum,max(changedate) changedate,status From MAXIMO.wostatus Where status=\'YZWAPPR\' Group By wonum,status) b
Where c.wonum=b.wonum And c.changedate=b.changedate And c.status=\'YZWAPPR\'
) a
where workorder.assetnum = asset.assetnum(+)
and workorder.location = locations.location(+)
and workorder.wonum=a.wonum(+)
and 1 = 1
语句1能查出的数据能在报表中正确处理,而语句2的不能,不知道具体是什么原因,红色部分不同。
[ 本帖最后由 W39 于 2007-7-29 11:07 编辑 ] |
|