I'm trying to build a query that takes a user default repair facility (DEFAULTREPFAC) from the MAXUSER table and uses it in another screen to filter data for a field called PLUSCPHYLOC which is in the ASSET table.
Here is my query:
((fxf_meterpercent > 95.0 or fxf_timepercent > 95.0) and ((siteid = 'FXFRTSID'))) and (exists (select 1 from maximo.asset where ((pluscphyloc like '%RDU%')) and (assetnum = pm.assetnum and siteid=pm.siteid) and (plustisconsist=0))) order by GREATEST(
COALESCE(fxf_timepercent, 0),
COALESCE(fxf_meterpercent, 0)
)desc
But instead of ((pluscphyloc like '%RDU%')) I'm looking for something like this.
and exists(select 1 from maxuser
where (userid= :&USERNAME&) and asset.pluscphyloc = maxuser.defaultrepfac)