Click or drag to resize
sqx

IDOFMIN Structure

Aggregate [int] IDOFMIN([int] ID, [float] Value, [int] Position)

Namespace:  sqx
Assembly:  SQX (in SQX.dll) Version: 1.0.2.6 (1.0.2.6)
Syntax
C#
[SerializableAttribute]
public struct IDOFMIN : IBinarySerialize
Remarks
ID of Min aggregate function.
Position > 0
Return ID order by Value.

NOTE: All parameters except ID and Value must remain constant within the GROUP BY.
NOTE: For small Datasets.

Attributes

Format.UserDefined, IsInvariantToDuplicates = false, IsInvariantToNulls = true, IsInvariantToOrder = true, IsNullIfEmpty = true, MaxByteSize = -1
Examples
SQL
DECLARE @Test TABLE (ID int NOT NULL IDENTITY, X float NULL, Y float NULL)
INSERT @Test (X, Y)
SELECT a.Value, b.Value
FROM sqx.UTable(100, 1) a INNER JOIN sqx.UTable(100, 2) b
ON a.ID = b.ID
SELECT * FROM @Test
SELECT p.Value Position
, sqx.IDOFMIN(ID, X, p.Value) LowestX
, sqx.IDOFMIN(ID, Y, p.Value) LowestY
FROM sqx.NTable(1, (SELECT COUNT(*) FROM @Test)) p, @Test
GROUP BY p.Value
See Also