i'am strugling how to get specific value from json field. I want to get the processor value from the selection_group field
This is working:
const result = await db.run(sql
SELECT supplier, brand, selection_group->>'processor', COUNT("id") as productCount FROM products GROUP BY supplier, brand, selection_group->>'processor'
SELECT supplier, brand, selection_group->>'processor', COUNT("id") as productCount FROM products GROUP BY supplier, brand, selection_group->>'processor'
);
When i use this:
.select(sql
supplier, brand, selection_group->>'processor', COUNT("id") as productCount
supplier, brand, selection_group->>'processor', COUNT("id") as productCount