By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select version();
version() |
---|
11.4.4-MariaDB-deb12 |
CREATE TABLE players (
playerId INT,uniqueId VARCHAR(20),game VARCHAR(20),
merge VARCHAR(20)
);
INSERT INTO players (playerId, uniqueId, game, merge)
VALUES (562, '[U:1:18893661]', 'cstrike', NULL);
select playerId, uniqueId, game,
cast(SUBSTRING(uniqueId, 6, LENGTH(uniqueId) - 5 -1 ) as UNSIGNED) + 76561197960265728 as communityId
from players
where playerId = 562;
playerId | uniqueId | game | communityId |
---|---|---|---|
562 | [U:1:18893661] | cstrike | 76561197979159389 |