{
  "name": "Compare 2 SQL datasets",
  "nodes": [
    {
      "id": "df04c503-d4af-4e8f-bcc3-f1fd02d3a332",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        780,
        340
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6fe78ae6-7325-4062-ab58-457dc1d985c4",
      "name": "Compare Datasets",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        1560,
        320
      ],
      "parameters": {
        "options": {
          "multipleMatches": "all"
        },
        "mergeByFields": {
          "values": [
            {
              "field1": "customerNumber",
              "field2": "customerNumber"
            },
            {
              "field1": "year",
              "field2": "year"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "0dae008c-242d-4757-a5a4-a075bde54cb6",
      "name": "Orders from 2003 and 2004",
      "type": "n8n-nodes-base.mySql",
      "position": [
        1080,
        220
      ],
      "parameters": {
        "query": "SELECT customerNumber, SUM(amount) as Total, COUNT(*) as ordercount, YEAR(paymentDate) as year\nFROM payments\nWHERE YEAR(paymentDate) = '2003' OR YEAR(paymentDate) = '2004'\nGROUP BY customerNumber, year\n;",
        "options": {},
        "operation": "executeQuery"
      },
      "typeVersion": 2.1
    },
    {
      "id": "c162e9b5-6e26-4a81-b90d-a5709e73019c",
      "name": "Orders from 2004 and 2005",
      "type": "n8n-nodes-base.mySql",
      "position": [
        1080,
        440
      ],
      "parameters": {
        "query": "SELECT customerNumber, SUM(amount) as Total, COUNT(*) as ordercount, YEAR(paymentDate) as year\nFROM payments\nWHERE YEAR(paymentDate) = '2004' OR YEAR(paymentDate) = '2005'\nGROUP BY customerNumber, year\n;",
        "options": {},
        "operation": "executeQuery"
      },
      "typeVersion": 2.1
    },
    {
      "id": "05547a67-2c53-43df-8abd-ee356f12742b",
      "name": "Change ordercount",
      "type": "n8n-nodes-base.set",
      "position": [
        1300,
        440
      ],
      "parameters": {
        "values": {
          "number": [
            {
              "name": "ordercount",
              "value": 1
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "f1e2b727-d738-58e4-82cd-a61044bc868f",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# Compare 2 SQL datasets\n\n## Purpose and structure\nThis folder contains the **Compare 2 SQL datasets** workflow. Its executable nodes use `compareDatasets`, `manualTrigger`, `mySql`, `set`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nWhen clicking \"Execute Workflow\"\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Manual/1851_Manual_Comparedatasets_Automation_Triggered.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "Change ordercount": {
      "main": [
        [
          {
            "node": "Compare Datasets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Orders from 2003 and 2004": {
      "main": [
        [
          {
            "node": "Compare Datasets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orders from 2004 and 2005": {
      "main": [
        [
          {
            "node": "Change ordercount",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Orders from 2003 and 2004",
            "type": "main",
            "index": 0
          },
          {
            "node": "Orders from 2004 and 2005",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
