How can I effectively use the J1QL string concatenation CONCAT () function?

dcpeach
dcpeach ✭✭✭✭✭
edited March 2022 in About the AskJ1 Community

By definition the CONCAT () function allows two or more query columns, strings, numbers and generates into one new string value.


Answers

  • jdowdy
    jdowdy ✭✭✭✭✭
    The following use cases will reveal the power of the CONCAT () function

    1. Identify github pull requests by account login and approver login?
    FIND github_pullrequest
      RETURN CONCAT(github_pullrequest.accountLogin, ', ',      
      github_pullrequest.approverLogins)
    2. Locate the last external ip address and the last internal ip address?
    FIND HostAgent 
      RETURN CONCAT(HostAgent.lastExternalIpAddress, ', ',   
      HostAgent.lastInternalIpAddress)
    3. Specify spot instances and their respective instanceIds.
    FIND aws_instance
      RETURN CONCAT(aws_instance.instanceLifecycle, ', ', 
      aws_instance.instanceId)

This Month's Leaders