Answer the question
In order to leave comments, you need to log in
SELECT NOT IN syntax error?
I am using pg-promise for nodejs .
It is necessary to make a selection according to the NOT IN condition. In the example, the parameter that comes in is an array.
https://github.com/vitaly-t/pg-promise/wiki/Learn-...
I have this view object
let obj = {
limit: limit,
list: list // массив здесь
};
return db.query(`
SELECT *
FROM table WHERE
id NOT IN (${obj.list}:csv)
LIMIT ${obj.limit}
`);
{ error: ошибка синтаксиса (примерное положение: ":")
Answer the question
In order to leave comments, you need to log in
What am I doing wrong?
db.query(`
SELECT *
FROM table
WHERE id NOT IN ($(list:csv))
LIMIT $(limit)
`, obj)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question