PHP код:
Query query;
QueryBuildDataSource qbDS1, qbDS2;
;
query = new Query();
qbDS1 = query.addDataSource(tableNum(InventTable));
qbDS2 = qbDS1.addDataSource(tableNum(InventItemLocation));
qbDS2.addLink(fieldNum(InventTable, ItemId), fieldNum(InventItemLocation, ItemId));
qbDS2.joinMode(JoinMode::EXISTSJOIN);
qbDS2.fetchMode(0);
info(qbDS1.toString());
qbDS2 = qbDS1.addDataSource(tableNum(InventTableModule));
qbDS2.addLink(fieldNum(InventTable, ItemId), fieldNum(InventTableModule, ItemId));
qbDS2.joinMode(JoinMode::EXISTSJOIN);
qbDS2.fetchMode(0);
info(qbDS1.toString());