Querying relationships
This section will explain how we can query relationships by using the JOIN
operator. The JOIN
operator allows us to join (or combine, as we say) different result sets of digital twins. You can add up to five JOIN
operators in one query.
There are some rules that we have to apply when using a JOIN
operator. These rules are as follows:
- We need to specify a name for a result set. That means that we need to replace
FROM DIGITALTWINS
with, for example,FROM DIGITALTWINS DT
.DT
, is, in this case, the name of the result set. The name can be anything we want. - The query is required to have a
$dtId
value in theWHERE
clause. - The
SELECT *
needs to be replaced with, for example,SELECT DT, RT
.DT
andRT
, in this case, are both result sets. At least one result set or a specific field in a result set is required.
The following query does a JOIN
operation between digital twins with a specified relationship called contains
. In our current Azure Digital...