The following query is in a database I'm working on
The value 'SABA' comes from a field on a form.
This query runs but I've been asked to make some changes to it.
The problem I have is that IWH.BASIC_UNIT_SUMMARY_FACT or IWH_BASIC_UNIT_SUMMARY_FACT doesn't exist as either a table or a query in the database (including all hidden objects). I've previously only worked with queries and tables as places from which to pull data, so this one is puzzling for me.
What kind of data source could this be and how can I look at it directly?
Code:
WITH PROVINCES (Code, Province) AS (VALUES ('01', 'BC'), ('02', 'ALTA'), ('03', 'SASK'), ('04','MAN'), ('05','ONT'), ('06','QUE'), ('07','NB'), ('08','NS'), ('09','PEI'), ('10','NFLD'), ('11', 'YUK'), ('12','NWT'), ('13','WHOLESALE')), SALESRETAIL (Code, Sales) AS
(SELECT PROVINCE_SORT_CODE As Code, Sum(QUANTITY) AS Sales
From IWH.BASIC_UNIT_SUMMARY_FACT
WHERE ( IWH.BASIC_UNIT_SUMMARY_FACT.VIN_PREFIX Like 'SABA%' )
AND PROVINCE_SORT_CODE <> '13'
AND (PRODUCT_LINE_CODE = 'M' OR PRODUCT_LINE_CODE = 'P')
GROUP BY ROLLUP(PROVINCE_SORT_CODE))
SELECT PROVINCES.Province, SALESRETAIL.Sales From PROVINCES RIGHT JOIN SALESRETAIL ON PROVINCES.Code = SALESRETAIL.Code
This query runs but I've been asked to make some changes to it.
The problem I have is that IWH.BASIC_UNIT_SUMMARY_FACT or IWH_BASIC_UNIT_SUMMARY_FACT doesn't exist as either a table or a query in the database (including all hidden objects). I've previously only worked with queries and tables as places from which to pull data, so this one is puzzling for me.
What kind of data source could this be and how can I look at it directly?