I have the following JS object:
var groups = [{id="4", name="abcd", id_group="1"}, {id="5", name="efgh", id_group="1"}, {id="6", name="ijkl", id_group="1"}, {id="4", name="abcd", id_group="2"}, {id="7", name="mnop", id_group="2"}]
And I need to execute this SQL query on the above object:
select id_group from groups where id in (4,7) group by id_group having count(distinct id) = 2
The result should be:
id_group="2"
because only this group contains both identifiers that are used in the request.
I found information about SQLike and JSLINQ but I ran into problems with where and with expressions. Is it possible to execute such a query in a javascript object using SQL-JS libraries or JS / jQuery itself (write function, etc.)?
source share