Project

General

Profile

« Previous | Next » 

Revision 6354

schemas/functions.sql: Added _merge_words()

View differences:

schemas/functions.sql
228 228

  
229 229

  
230 230
--
231
-- Name: _merge_words(anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: -
232
--
233

  
234
CREATE FUNCTION _merge_words("0" anyelement DEFAULT NULL::unknown, "1" anyelement DEFAULT NULL::unknown, "2" anyelement DEFAULT NULL::unknown, "3" anyelement DEFAULT NULL::unknown, "4" anyelement DEFAULT NULL::unknown, "5" anyelement DEFAULT NULL::unknown, "6" anyelement DEFAULT NULL::unknown, "7" anyelement DEFAULT NULL::unknown, "8" anyelement DEFAULT NULL::unknown, "9" anyelement DEFAULT NULL::unknown) RETURNS anyelement
235
    LANGUAGE sql IMMUTABLE
236
    AS $_$
237
SELECT functions.join_strs(value, ' ')
238
FROM
239
(
240
    SELECT *
241
    FROM
242
    (
243
        SELECT
244
        DISTINCT ON (value)
245
        *
246
        FROM
247
        (VALUES
248
              (1, $1)
249
            , (2, $2)
250
            , (3, $3)
251
            , (4, $4)
252
            , (5, $5)
253
            , (6, $6)
254
            , (7, $7)
255
            , (8, $8)
256
            , (9, $9)
257
            , (10, $10)
258
        )
259
        AS v (sort_order, value)
260
        WHERE value IS NOT NULL
261
    )
262
    AS v
263
    ORDER BY sort_order
264
)
265
AS v
266
$_$;
267

  
268

  
269
--
231 270
-- Name: _min(anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: -
232 271
--
233 272

  

Also available in: Unified diff