Wednesday, 15 January 2014

database - Select max from multiple tables using angularjs and sqlite -


I have a table called "clients" and the other is called "phone", both of them have "_modificado" one The column is a timestamp, I use the function to get the last modified item to compare with my API and then updating it.

How can I use the same function to recover the results of 2 tables?

getLastSyncClientes (param) {db.transaction (function (tx) {var sql = "select MAX (_modificado) clientsS as lastS"; tx.executeSql (sql, [] , Function (tx, result) {var lastSync = results.rows.item (0) .lastS; param (lastSync); log ('last local timestamp is' last sync);});}, txErrorHandler, function () { }); }

Maximize for each table, then combine them:

(Select MAX (_modification)), (Select from Phone MAX (_modification)) Previous S

No comments:

Post a Comment