Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 函数的作用是:从其中的字符串中提取若干字符_Mysql_Sql_Sequelize.js - Fatal编程技术网

Mysql 函数的作用是:从其中的字符串中提取若干字符

Mysql 函数的作用是:从其中的字符串中提取若干字符,mysql,sql,sequelize.js,Mysql,Sql,Sequelize.js,如何构建此查询? 在文档中,我没有找到任何关于左函数的引用:( 有什么想法吗?我想你可以: await Customers.findOne({ where: { CustomerName: { [Op.startsWith] : 'An' } } }); 谢谢!!运算符Likein start with,起作用。``等待客户.findOne({where:{CustomerName:{[Op.Like]

如何构建此查询? 在文档中,我没有找到任何关于左函数的引用:(

有什么想法吗?

我想你可以:

await Customers.findOne({
      where: {
          CustomerName: {
              [Op.startsWith] : 'An'
          }
      }
});

谢谢!!运算符
Like
in start with,起作用。``等待客户.findOne({where:{CustomerName:{[Op.Like]:'An%}}}});``但是startsWith不起作用?Like应该同样好,但是文档确实显示了startsWith
await Customers.findOne({
      where: {
          CustomerName: {
              [Op.startsWith] : 'An'
          }
      }
});