Merge Node SQL Column Name the Same

Using Merge, two streams JSON in, combine with SQL. Select a field from input1 and UNION that with a field from input2. However, the result assumes the name of the first input, despite returning two.

[
  {
    "A.field": "Trco8vHJq"
  },
  {
    "A.field": "Trco8vHJqiS9otZUUljHcDrIaJUEasPx+jzltSrbs+E="
  }
]

The SQL statement can be simple or highly formatted, same result.

SELECT newstatementhash AS [A.field]
FROM input1 AS [A]
UNION
SELECT DocumentHash  AS [B.field]
FROM input2 AS [B]

Am I stupid, or is this a system problem?

N8N community - self hosted.
No database, just Merge node
N8N on Azure container
OS = Linux

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Okay, I am the idiot. UNION… field names can’t be different.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.