Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Snippets

Prophet731 edited this page Apr 4, 2016 · 2 revisions

Update chatlog table so that players with nulls for logPlayerID field can be updated.

UPDATE `tbl_chatlog` AS a 
SET 
    a.`logPlayerID` = (SELECT 
            b.`PlayerID`
        FROM
            `tbl_server`
                INNER JOIN
            `tbl_games` ON `tbl_server`.`GameID` = `tbl_games`.`GameID`
                INNER JOIN
            `tbl_playerdata` AS b ON `tbl_games`.`GameID` = b.`GameID`
        WHERE
            b.`SoldierName` = a.logSoldierName
                AND `tbl_server`.`ServerID` = a.ServerID
        LIMIT 1)
WHERE
    a.logPlayerID IS NULL
Clone this wiki locally