how can we add 'and' 'or' and 'not' condition in where clause?
ankurshah32 opened this issue · 2 comments
how can we add 'and' 'or' and 'not' condition in where clause for example
Select * from 'table_name' where date >= ' ' and date <= ' '
Select * from 'table_name' where number = 5 or number = 10
Select * from 'table_name' where date != 6
how can we add 'and' 'or' and 'not' condition in where clause for example
Select * from 'table_name' where date >= ' ' and date <= ' '
Select * from 'table_name' where number = 5 or number = 10
Select * from 'table_name' where date != 6
I think syntax like mongodb
you can use
//Select * from 'table_name' where date >= ' ' and date <= ' '
var sqlRes1= sql.$select({
$from: 'table_name',
$where: {
$and:[{date: {$gte:""}},{date: {$lte:""}}],
}
});
console.log(sqlRes1);
//Select * from 'table_name' where number = 5 or number = 10
var sqlRes2= sql.$select({
$from: 'table_name',
$where: {
$or:[{number :5},{number : 10}],
}
});
console.log(sqlRes2);
//Select * from 'table_name' where date != 6
var sqlRes3= sql.$select({
$from: 'table_name',
$where: {
date :{$ne:6}
}
});
console.log(sqlRes3);
hope this can help you
Tanin Pongpunyayeen
Absolute right