適用於:SQL Server
Azure SQL Database
Azure SQL Managed Instance
Microsoft Fabric 中的 SQL 資料庫
從 geography 物件集建立 GeometryCollection 執行個體。
Syntax
CollectionAggregate ( geography_operand )
Arguments
geography_operand
這是 geography 型別資料表資料行,代表要列於 GeometryCollection 執行個體中的 geography 物件集。
傳回型別
SQL Server 傳回類型:geography
Exception
輸入的值無效時,會擲回 FormatException。 請參閱 STIsValid (geography 資料類型)
Remarks
當輸入是空的或輸入具有不同 SRID 時,此方法會傳回 null。 請參閱空間參考識別碼 (SRID)
此方法會忽略 null 輸入。
Note
如果所有輸入的值都為 null,此方法就會傳回 null。
Examples
下列範例會傳回包含 GeometryCollection 物件集的 執行個體。
USE AdventureWorks2022
GO
SELECT geography::CollectionAggregate(SpatialLocation).ToString() AS SpatialLocation
FROM Person.Address
WHERE City LIKE ('Bothell')