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.
Help with SQL Query about Clans and Leaders
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- janiii
- L2j Veteran
- Posts: 4269
- Joined: Wed May 28, 2008 3:15 pm
- Location: Slovakia
Re: Help with SQL Query about Clans and Leaders
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!
forum flOOder dancing dEVILoper ♀
I don't give private support - PM will be ignored!
-
- Posts: 85
- Joined: Mon Dec 17, 2007 1:18 am