I have one field and it has a semicolon identifier , so I want to find from this selected identifier, here is my code,
.get(function(req, res) {
knex.select('*')
.from('exam')
.whereRaw('? = any(regexp_split_to_array(student_id))', [req.params.id])
.then(function(rows) {
console.log(rows);
})
.catch(function(error) {
console.log(error)
});
});
===> while I use KNEX , it will throw an error.
{ error: function regexp_split_to_array(text) does not exist
name: 'error',
length: 220,
severity: 'ERROR',
code: '42883',
detail: undefined,
hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
position: '37',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_func.c',
line: '523',
routine: 'ParseFuncOrColumn'
}
- in the student_id column i have an ID like this, 33,34,35,36
- in req.params.id I have only one ID, for example 35.
- so I want rows that include 35 identifiers in the same table.

===> So, I want only two rows (2,3), because it includes ID = 35.
source
share