sqlite 表查询 替换问题
代码_SQLite_Exec(-1, "select fightlog.name from fightlog except select alluser.name from alluser;", '_cb');对比新旧数据,导出不重复的新数据_SQLite_SQLiteExe("WX角色108.db", "replace into alluser select name,fight from fightlog where fight.name in (select fightlog.name from fightlog INTERSECT select alluser.name from alluser);", $oOUT)表1
alluser
name fightmajor
张一 null null
张二 null null
表2
fightlog
namefight
张一 武术
我的思路是,取表2和表1相同的部分,然后回写到表1,
没报错,但也没写进去 自己顶一下吧 我不會 SQLLITE只會SQL @@
UPDATE 表一 SET 表一.FIGHT=表2.FIGHT FOROM 表2 Where 表一.name=表2.NAME 本帖最后由 lluxury 于 2011-5-17 17:42 编辑
我不會 SQLLITE只會SQL @@
UPDATE 表一 SET 表一.FIGHT=表2.FIGHT FOROM 表2 Where 表一.name=表2.NAM ...
kk_lee69 发表于 2011-5-17 15:50 http://www.autoitx.com/images/common/back.gif
谢谢,我试试
! SQLite.au3 Error
--> Function: _SQLite_Query
--> Query: UPDATE alluser SET alluser.FIGHT=fightlog.FIGHT FROM fightlog Where alluser.name=fightlog.NAME);
--> Error: near ".": syntax error UPDATE alluser SET alluser.FIGHT=(select max(fightlog.FIGHT) FROM fightlog Where alluser.name=fightlog.NAME) where alluser.FIGHT is null 果然每個資料庫 可以用的語法都不一樣 >< UPDATE alluser SET alluser.FIGHT=(select max(fightlog.FIGHT) FROM fightlog Where alluser.name=fightl ...
auto 发表于 2011-5-18 14:13 http://www.autoitx.com/images/common/back.gif
谢谢,回去试一下这个,我是用联合查询然后生成新表解决的
页:
[1]