• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] [Extraction] Finding the appropriate SQL Query (Help) .

Status
Not open for further replies.

callmephil

Respected Member
Hello, I have an issue about finding the appropriate query to update a custom table via characters.

Actually i'm trying to Update `name` AND `race` from characters to my custom table via the Same player guid

so i tried several query like.

Code:
UPDATE `DataUP` 
SET DataUP.name = characters.name,
DataUP.race = characters.race
FROM `DataUP`,`characters`
WHERE characters.guid = DataUP.guid;

or

Code:
UPDATE DataUP SET `name`,`race` FROM characters WHERE DataUP.guid = characters.guid;

but nothing works anyone can help?
 

Grandelf

Esteemed Member
This should work:
Code:
INSERT INTO dataUP
SELECT
	/* Put this in the order 
	of your database structure. */
	name,
	race
FROM characters;
Be sure to put the name and race in the order as they are in your database.
So name should be column 1 and race column 2 etc.

Edit:
I am stupid, you're trying to update it >.>, give me a second ...

There we go:
Code:
UPDATE DataUP D
	INNER JOIN characters C
	SET	D.name = C.name,
		D.race = C.race;
 
Last edited:

callmephil

Respected Member
Finally ! Thanks Grandelf

Code:
UPDATE battleground_top_40 D
INNER JOIN characters C
SET D.name = C.name,
    D.race = C.race
WHERE D.guid = C.guid;
 
Status
Not open for further replies.
Top