We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GROUP BY
1 parent cee332c commit e9b503aCopy full SHA for e9b503a
sql/010-core.sql
@@ -351,3 +351,17 @@ CREATE FUNCTION cs_ore_64_8_v1(val jsonb)
351
BEGIN ATOMIC
352
RETURN cs_ore_64_8_v1_v0_0(val);
353
END;
354
+
355
+DROP FUNCTION IF EXISTS _cs_first_grouped_value(jsonb, jsonb);
356
357
+CREATE FUNCTION _cs_first_grouped_value(jsonb, jsonb)
358
+RETURNS jsonb AS $$
359
+ SELECT COALESCE($1, $2);
360
+$$ LANGUAGE sql IMMUTABLE;
361
362
+DROP AGGREGATE IF EXISTS cs_grouped_value_v1(jsonb);
363
364
+CREATE AGGREGATE cs_grouped_value_v1(jsonb) (
365
+ SFUNC = _cs_first_grouped_value,
366
+ STYPE = jsonb
367
+);
0 commit comments