I've got a lot of new data coming into my program that I need to quickly associate with existing data in a table so I can then filter out the approved: false
ones.
Here's as distilled as I can think to make the situation:
Given the following:
const list = [{id: 1}, {id: 2}]
// assume ~10K items, not necessarily 1-1 with the MyTable's rows.
INSERT INTO MyTable (id, approved) VALUES (1, TRUE), (2, FALSE), (3, TRUE);
-- assume ~10K rows
How to get to this?
const result = [{id: 1, approved: true}, {id: 2, approved: false}] // only ids from list
I'm asking what SQL query will get from the givens to the result.