开发者

Start Center Result Set for People Table

开发者 https://www.devze.com 2023-02-02 10:56 出处:网络
I am working with the Maximo Asset Management System (version 7.1.1.6). I am trying to display a result set on the start center that contains a Do Not Call list of specific people. However, when usin开

I am working with the Maximo Asset Management System (version 7.1.1.6). I am trying to display a result set on the start center that contains a Do Not Call list of specific people. However, when usin开发者_开发技巧g a query for the result set (a query that was saved in the People section that contains the appropriate "where" clause such as "department='ABC'"), I cannot select the phone number or the email address as a column to display. I believe this is due to the fact that the "Primary Phone" and "Primary Email" fields in the person table are not really there. They are virtual fields that are connected in the People application to the Phone and Email tables and joined on the personid column. If I run the following query in the database, I get the result set that I want:

select * from dbo.person as p 
left outer join dbo.phone as ph on p.personid=ph.personid and ph.isprimary=1 
left outer join dbo.email as e on p.personid=e.personid and e.isprimary=1 

Unfortunately for the result sets, you don't have access to the "FROM" clause you can only edit the "WHERE" clause.

Anyone have any idea how to solve this other than adding 2 new columns to the person table for primary phone and primary email? I don't want to HAVE to do it, but I can if I must.


How about this for a where clause

... where (select count(*) from dbo.phone ph where :personid = ph.personid and ph.isprimary=1) > 0 and (select count(*) from dbo.email e where :personid = e.personid and e.isprimary=1) > 0

I can also think of a solution creating a relationships in the database configuration application, but the above query is more straight forward.

0

精彩评论

暂无评论...
验证码 换一张
取 消