Loading TOC...

MarkLogic Server 11.0 Product Documentation
op:join-full-outer

op:join-full-outer(
   $leftPlan as map:map,
   $rightPlan as map:map,
   [$keys as map:map*],
   [$condition as map:map?]
) as map:map

Summary

This method yields one output row set with the rows from an inner join as well as the other rows from both the left and right row sets.

The join performs natural joins between columns with the same identifiers. To prevent inadvertent natural joins, specify a different qualifier for the left or right columns or use different column names for the left and right columns.

Parameters
$leftPlan The row set from the left view.
$rightPlan The row set from the right view.
$keys The equijoin from one or more calls to the op:on function.
$condition A boolean expression that filters the join output rows.

Example

xquery version "1.0-ml";

import module namespace op="http://marklogic.com/optic"
     at "/MarkLogic/optic.xqy";

let $employees := op:from-view("main", "employees")
let $locations := op:from-view("main", "locations")
return $employees
   => op:join-full-outer($locations, op:on(
                  op:view-col("employees", "LocationID"),
                  op:view-col("Locations", "LocationID")))

   => op:result()
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.