You need to sign in to do that
Don't have an account?
Pavithra Gajendra
Smart SQL
In Hybrid app I want to query from smartstore based on 2 different conditions dynamically. Tired the below, but didn't work for me
var querySpec = navigator.smartstore.buildSmartQuerySpec(""SELECT * FROM {MONTH_OBJECT} WHERE {MONTH_OBJECT:Month} ='"+ month+"'"+ "AND {MONTH__OBJECT:Date} ='"+date+"'", 1);
navigator.smartstore.runSmartQuery(querySpec, function(cursor) {
});
How to write a smart sql query for more than 1 condition?
var querySpec = navigator.smartstore.buildSmartQuerySpec(""SELECT * FROM {MONTH_OBJECT} WHERE {MONTH_OBJECT:Month} ='"+ month+"'"+ "AND {MONTH__OBJECT:Date} ='"+date+"'", 1);
navigator.smartstore.runSmartQuery(querySpec, function(cursor) {
});
How to write a smart sql query for more than 1 condition?
To include more than one condition, we can use ANDm, OR ,IN keywords in Where clause.
Here are some sample code you will find:
http://www.tutorialspoint.com/sql/sql-and-or-clauses.htm
Thanks,
Pratik