Retrieve the data in two collections

Suppose I have two collections under a database
One is (A)


Another is (B)



How can I make the query in these two collections just like SQL in two tables
select A.password from A,B where B.UserGroupName = ‘HAHA’ ??

this will be very easy with the query language XQuery (formerly called XML Query by the W3C) which is available in Tamino 4.1 and above. You can specify inner and outer joins and do exactly what you asked for. In the “Welcome To Tamino” demo application “First Steps” (available on IE browsers only) you will find an example for such a XQuery. There you have two docnames named “property” and “person” in the collection RealEstate and the query reads:

for $p in input()/property
let $x := $p/@contactPerson
for $q in input()/person
where $p/@category=‘Sell’ and $x = $q/@id
return $q

This will look into “property” and retrieve the ID of the contactPerson and will look up the details for this ID in “person”.
Hope that helps

Gerald Ristow
Tamino R&D