JSFiddle - React, Tailwind, and code Playground
by ysuper
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<xmp id="res"></xmp>
JavaScript
var data = [{a:1,b:10}, {a:2,b:20}, {a:1,b:30}];
var res = alasql('SELECT a, SUM(b) AS b FROM ? GROUP BY a',[data]);
document.getElementById("res").textContent = JSON.stringify(res, null, 2);