TRBizeps 49 Posted November 6, 2016 Share Posted November 6, 2016 I need some help in mysql querys, i extracted the new mob_proto by gameforge client as you may know some columns are missing because they dont save them clientside so i need a query for .sql i want to export 1 or 2 colums from mob_proto2 to mob_proto1 with checked by vnum so it exports from mob.proto2 monster 101 to mob_proto1 101 column gold_min i tryed this but it does not work SELECT mob_proto2.damage_min UPDATE mob_proto.damage_min WHERE mob_proto2.vnum = mob_proto.vnum ); Link to comment Share on other sites More sharing options...
luzzo 197 Posted November 6, 2016 Share Posted November 6, 2016 You type quite right. So first of all be carefull doing query like this(that's and implicit join). Note: You have to specify table and attr to not be ambiguos. Anyway in your case: To Extract and update this is the right syntax: UPDATE mob_proto SET mob_proto.damage_min=(SELECT damage_min FROM mob_proto_copy WHERE mob_proto.vnum=mob_proto_copy.vnum); To check if all is gone well then type something like this: select vnum from mob_proto where NOT EXISTS(select * from mob_proto_copy where mob_proto.vnum = mob_proto_copy.vnum and mob_proto.damage_min = mob_proto_copy.damage_min); Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now