Dev Helpers
← Back

Zip labels with measurements by index

Zip labels with measurements by index using SQLite JSON functions.

Open this example in the interactive library

Source code

SELECT a.value AS label,b.value AS reading FROM json_each('["in","out"]') a JOIN json_each('[18,21]') b USING(key) ORDER BY a.key;

Sample output

[
  {
    "label": "in",
    "reading": 18
  },
  {
    "label": "out",
    "reading": 21
  }
]