I am fetching opportunity and territory data from Salesforce through data direct driver. The data can be extracted by "Select territory2.name from opportunity". Please provide inputs to implement the same query through data direct driver.
Are you trying to do a JOIN query between Opportunity and a custom object called "Territory2"? If so, the query you are looking for is "Select TERRITORY2.NAME from TERRTORY2 join OPPORTUNITY on <some_search_criteria>"