Create a VIEW (PIVOT) in Enterprise Geodatase

1096
4
03-28-2020 04:07 PM
WilsonLee
Occasional Contributor

Hi,

I'm new to sql/creating a pivot table as a view in Geodatabase.

I'm looking for the SQL query for the "Create New View" tool (see attached screenshot)

I tried to google many samples but it didn't work out. While I'm still googling, i thought i could ask you guys for help.

My goal is to create a VIEW (PIVOT) based on an existing table in the Geodatabase:

any direction, inputs, sample are appreciated!!!

million thanks!!

Existing table in Geodatabase:

Building NameStatus
Building A
Open
Building A
Open
Building A
Closed
Building B
Closed
Building B
Unknown
Building C
Unknown
Building D
Open

my goal is to create a VIEW (pivot) below based on the TABLE above

Building NameOpenClosedUnknown
Building A
210
Building B
011
Building C
001
Building D
100
Tags (3)
0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus

like this but not exact, but worth a look

Pivot Table—Data Management toolbox | Documentation 

WilsonLee
Occasional Contributor

thanks,

but i'm looking for the actual SQL Definition in the "Create New View" Tool , see my screenshot

but thanks anyway

0 Kudos
DanPatterson_Retired
MVP Emeritus
JoshuaBixby
MVP Esteemed Contributor

The syntax for creating higher-level aggregation SQL, like PIVOT, tends to be very implementation specific, so it is crucial to share what DBMS is hosting the geodatabase. 

0 Kudos