SQLite搜索查询

SQLite搜索查询,sqlite,ionic2,Sqlite,Ionic2,我想从本地存储中搜索,对于Ionic2的Sqlite查询将是什么- 从本地存储中搜索数字的sql查询是什么。 类似这样的事情- 从mytable中选择行id,其中*类似于“%searched\u text%” var searchmobile=newvalue this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?", [searchmobile]

我想从本地存储中搜索,对于Ionic2的Sqlite查询将是什么- 从本地存储中搜索数字的sql查询是什么。 类似这样的事情- 从mytable中选择行id,其中*类似于“%searched\u text%”

 var searchmobile=newvalue
          this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?",
            [searchmobile]).then((customerdata) => 

尝试将searchmobile连接起来,如:

 var searchmobile=newvalue
          this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?",
            ['%' + searchmobile + '%']).then((customerdata) =>  

您需要在执行查询之前打开数据库

`var searchmobile=newvalue
this.database = new SQLite();
this.database.openDatabase({
        name: "data.db",
        location: "default"
      }).then(() => {
this.database.executeSql("SELECT mobile_no FROM customer WHERE mobile_no like ?",
            [searchmobile]).then((customerdata) =>`

@我要传递一个变量“searchmobile”,怎么做?