 -- Get the WASH data requirement of ObjectTypes and Attributes
 	
 SELECT DISTINCT  ObjectType AS WASHObjectType,ObjectTypeCV AS WASHObjectTypeCV ,AttributeName AS WASHAttributeName,AttributeNameCV AS WASHAttributeNameCV
-FROM Datasets
+FROM ResourceTypes
 
-LEFT JOIN "ObjectTypes" 
-ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID"
+Left JOIN "ObjectTypes" 
+ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID"
 
 LEFT JOIN  "ObjectCategories"
 ON "ObjectCategories"."ObjectCategoryID"="ObjectTypes"."ObjectCategoryID" 

	
SELECT Distinct ObjectTypeCV,AttributeNameCV

FROM Datasets

LEFT JOIN "ObjectTypes" 
ON "ObjectTypes"."DatasetID"="Datasets"."DatasetID"

LEFT JOIN  "Attributes"
ON "Attributes"."ObjectTypeID"="ObjectTypes"."ObjectTypeID" 


--WHERE "DatasetAcronym"=’WASH’

Adel Abdallah 
April 2, 2018

*/
-- Show the join results for the native WEAP Object Types and Attributes
