Jump to content

mysql query (important pls help)


Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.