View Specific Territory

Friday Apr 7th 2006 by DatabaseJournal.com Staff
Share:

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



>>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

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved