A newer version of this documentation is available.

View Latest

String Operators

  • reference
    +

    N1QL provides the concatenation string operator.

    Concatenation

    The concatenation operator joins two strings. The result of the concatenation operator is also a string.

    Syntax

    expression || expression
    Syntax diagram

    Example

    The following example shows concatenation of two strings.

    Query
    SELECT fname || " " || lname AS full_name
        FROM tutorial
    Result
     {
      "results": [
        {
          "full_name": "Dave Smith"
        },
        {
          "full_name": "Earl Johnson"
        },
        {
          "full_name": "Fred Jackson"
        },
        {
          "full_name": "Harry Jackson"
        },
        {
          "full_name": "Ian Taylor"
        },
        {
          "full_name": "Jane Edwards"
        }
      ]
    }

    Refer to Comparison Operators for string comparisons.