View Specific Territory | Database Journal

View Specific Territory

Apr 7, 2006
1 minute read

>>Script Language and Platform: SQL Plus

This script will display the Customers which fall within a specific territory, with all the customer names and customer ID.

Author: Srikanth


SELECT RC.CUSTOMER_ID,
           RC.CUSTOMER_NUMBER,
           RC.CUSTOMER_NAME,
           RAT.SEGMENT2,
           RAT.SEGMENT3
FROM   RA_CUSTOMERS RC,
           RA_TERRITORIES RAT ,
           RA_ADDRESSES_ALL RAA,
           RA_SITE_USES_ALL SUA
WHERE  RC.PARTY_ID = RAA.PARTY_ID
AND    RC.CUSTOMER_ID = RAA.CUSTOMER_ID
AND    RAA.ADDRESS_ID = SUA.ADDRESS_ID
AND    SUA.TERRITORY_ID = RAT.TERRITORY_ID
AND    SEGMENT2 LIKE ‘%TICI_NORTH_1%’
GROUP BY
          RC.CUSTOMER_ID,
           RC.CUSTOMER_NUMBER,
           RC.CUSTOMER_NAME,
           RAT.SEGMENT2,
           RAT.SEGMENT3



Disclaimer:
We hope that the information on these script pages is
valuable to you. Your use of the information contained in these pages,
however, is at your sole risk. All information on these pages is provided
“as -is”, without any warranty, whether express or implied, of its accuracy,
completeness, or fitness for a particular purpose…

Disclaimer Continued

Back to Database Journal Home

Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.