开发者

Correct way to use SELECT INTO with WebSQL and HTML 5?

开发者 https://www.devze.com 2023-04-03 17:01 出处:网络
speeddial.storage.Sync = function() { chrome.bookmarks.getChildren(String(localStorage[\'rootFolderID\']), function(newSync){
speeddial.storage.Sync = function() {
  chrome.bookmarks.getChildren(String(localStorage['rootFolderID']), function(newSync){
    speeddial.storage.db.transaction(function(tx){
      tx.executeSql('DELETE FROM bookmarksSync',null,null,speeddial.storage.onError);   
      tx.executeSql('DELETE FROM groupsSync',null,null,speeddial.storage.onError);  
      for (var i=0; i<newSync.length; i++){
    if(!newSync[i].url)
    {
      tx.executeSql('SELECT INTO groupsSync FROM groups', [],null
      ,speeddial.storage.onError);
    }
    ...
    //above is the end of else statement
      }
    })
  })
}

I want to use SELECT * INTO to copy some values from one SQL table to another. When I use the above I get near INTO syntax error. I WANT TO NOW HOW TO DO BOTH THINGS - copy the values of some columns form table A to table B based on a specific column value, and completely replacing the c开发者_如何学Contend of table A with this of table B Thank you ;)


Try:

INSERT INTO groupsSync SELECT * FROM groups

For more information on websql queries look into sqlite INSERT INTO syntax documentation

0

精彩评论

暂无评论...
验证码 换一张
取 消