Skip to content

Commit

Permalink
Create Specific_Instance_ Implementations.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Adel M. Abdallah authored Nov 9, 2018
1 parent e39a44a commit e1a706d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions 4_Queries_SQL/Specific_Instance_ Implementations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-- Show how Hyrum Reservoir node instance has seven different implementations
-- where ObjectTypeCV and InstanceNameCV make all of them related.

SELECT DISTINCT ResourceTypeAcronym,MasterNetworkName, ScenarioName,ObjectTypeCV,ObjectType,InstanceNameCV,InstanceName

FROM ResourceTypes

Left JOIN "ObjectTypes"
ON "ObjectTypes"."ResourceTypeID"="ResourceTypes"."ResourceTypeID"

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

LEFT JOIN "Mappings"
ON "Mappings"."AttributeID"= "Attributes"."AttributeID"

LEFT JOIN "Instances"
ON "Instances"."InstanceID"="Mappings"."InstanceID"

LEFT JOIN "ValuesMapper"
ON "ValuesMapper"."ValuesMapperID"="Mappings"."ValuesMapperID"

LEFT JOIN "ScenarioMappings"
ON "ScenarioMappings"."MappingID"="Mappings"."MappingID"

LEFT JOIN "Scenarios"
ON "Scenarios"."ScenarioID"="ScenarioMappings"."ScenarioID"

LEFT JOIN "MasterNetworks"
ON "MasterNetworks"."MasterNetworkID"="Scenarios"."MasterNetworkID"



-- Specifiy controlled Object Type, instance name, and an attribute of interest
WHERE ObjectTypeCV='Reservoir' and InstanceNameCV='Hyrum Reservoir'


0 comments on commit e1a706d

Please sign in to comment.