I am trying to join the results of two searches so it looks like this:
CWID, authorization_pk,weillCornellEduPrimaryTitle
paa2013, 1234, IT Support Manager
paa2013, 5678, IT Support Manager
paa2013, 9123, IT Support Manager
**
The "AcctAdmin" search returns only 3 results...
CWID, authorization_pk
paa2013, 1234
paa2013, 5678
paa2013, 9123
The "LDAP" search returns 150,000 results...
CWID, weillCornellEduPrimaryTitle
paa2013, IT Support Manager
brb2009, Professor
ala9001, Help Desk Technician
[150,000 more results!]
**
Search #1, in which I start with the smaller result and join against the larger result. I presume this would be more efficient, but it doesn't work:
| dbquery "AcctAdmin" "select CWID, authorization_pk from database.authorization a
left join people_db.service s on s.service_pk = a.service_fk
left join people_db.person p on p.PERSON_PK = a.PERSON_FK
where CWID ='paa2013'"
| rename CWID as weillCornellEduCWID
| join weillCornellEduCWID [
| ldapsearch domain=ED-people search="objectClass=eduPerson" attrs="weillCornellEduCWID,weillCornellEduPrimaryTitle"
| table weillCornellEduCWID, weillCornellEduPrimaryTitle
]
| table *
Search #2, in which I start with the larger result and join against the smaller result, does:
| ldapsearch domain=ED-people search="objectClass=eduPerson" attrs="weillCornellEduCWID,weillCornellEduPrimaryTitle"
| table weillCornellEduCWID, weillCornellEduPrimaryTitle
| rename weillCornellEduCWID AS CWID
| join CWID [
| dbquery "AcctAdmin" "select CWID, authorization_pk from people_db.database a
left join people_db.service s on s.service_pk = a.service_fk
left join people_db.person p on p.PERSON_PK = a.PERSON_FK
where CWID ='paa2013'" ]
| table *
A lot of answers here suggest JOIN is inefficient but I don't see another way to do this. Oh, and "max=0" is no help.
... View more