Maximo setWhere()查询获得不同的结果?

时间:2014-04-14 11:29:17

标签: java tivoli maximo

我正在尝试执行此SQL查询:
select distinct wonum from invreserve where location='01' order by wonum;

如何将其转换为setWhere()查询?我试过了:

invreserveSet.setWhere("(1 = 1) and wonum in (select distinct wonum from invreserve where location='01')");

1 个答案:

答案 0 :(得分:2)

使用类似的东西:

select invreserveid from invreserve where invreserveid in (select invreserveid from invreserve invr2 where location like '%B%'
and invreserveid = (select max(invreserveid) from invreserve invr3 where invr3.location = invr2.location and invr3.wonum = invr2.wonum)) 
;  

所以你的where子句与这些子句相同,只是你的位置通配符会有所不同。