I need to create a SELECT that contains only records of an x value onwards. For example, returning only movies with number of copies greater than 5
My Select
router.get('/filmes', (req, res) =>{
execSQLQuery('SELECT IF(copias > 5) from filmes', res);
});
FIlmes Table
CREATE TABLE filme(
id int not null Primary Key Auto_Increment,
titulo varchar(255) not null,
diretor varchar(255) not null,
copias int not null
);
Error returned in Insomnia
{
"code": "ER_PARSE_ERROR",
"errno": 1064,
"sqlMessage": "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') from filmes' at line 1",
"sqlState": "42000",
"index": 0,
"sql": "SELECT IF(copias > 5) from filmes"
}