PHP код:
public void init()
{
Query query;
QueryBuildDataSource qbds_Table0;
QueryBuildDataSource qbds_Table1;
QueryBuildDataSource qbds_Table2;
;
super();
Query = new Query();
qbds_Table0= Query.addDataSource(tablenum(Table0),"t0");
qbds_Table0.relations(false);
qbds_Table1= qbds_Table0.addDataSource(tablenum(Table1),"t1");
qbds_Table1.joinMode(JoinMode::ExistsJoin);
qbds_Table1.fetchMode(0);
qbds_Table1.relations(false);
qbds_Table2= qbds_Table0.addDataSource(tablenum(Table2),"t2");
qbds_Table2.joinMode(JoinMode::ExistsJoin);
qbds_Table2.fetchMode(0);
qbds_Table2.relations(false);
qbds_Table2.addRange(fieldnum(Table2,Field1 )).value("( (t1.Field1 LIKE 'Значение%') || (t2.Field2 LIKE 'Значение%'))");
this.query(Query);
Info(this.query().dataSourceNo(1).tostring());
}