Help with SQL Query about Clans and Leaders

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
nekys
Posts: 85
Joined: Mon Dec 17, 2007 1:18 am

Help with SQL Query about Clans and Leaders

Post by nekys »

Hello. Due to a mistake by my side, almost all characters are without Clan (including members).

I want someone to make me an SQL query that will take the leader ID from clan_data table and update the clanid on the leader's characters table entry.

So leader has clan ID on the characters table.
clan_data table is not damaged.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Help with SQL Query about Clans and Leaders

Post by janiii »

try this one (be sure to test it on a test table before running on live!)

Code: Select all

update characters set clanid = (select clan_id from clan_data where characters.charId = clan_data.leader_id);
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
nekys
Posts: 85
Joined: Mon Dec 17, 2007 1:18 am

Re: Help with SQL Query about Clans and Leaders

Post by nekys »

Thank you!
Post Reply