SELECT sensor_instances.*,
row_to_json((SELECT d
FROM (SELECT groups.*) d
)) AS group,
row_to_json((SELECT a
FROM (SELECT addresses.*) a
)) AS currentAddress,
(
SELECT JSON_AGG(src)
FROM (SELECT sensor_parameters.*
FROM sensor_parameters
WHERE sensor_parameters.sensortype = sensor_instances.sensortype
) src
) AS parameters
FROM sensor_instances
LEFT JOIN groups ON groups.id = sensor_instances.groupid
LEFT JOIN addresses ON sensor_instances.addressid = addresses.id
WHERE sensor_instances.id IN (439)
function onClickCheckboxRow(data) {
$(".checkbox").change((e) => {
console.log(data, e);
});
}
function displayLine(data) {
$('#results').append(`
<tr>
<th scope="row">${importLines.length}</th>
<td><input class="checkbox" type="checkbox"></td>
<td>${data[0]}</td>
<td>${data[2]}</td>
<td>${data[11]}</td>
<td id="status-${data[0]}"><b><span style="color: orange">PENDING</span></b></td>
</tr>
`, onClickCheckboxRow(data));
}