There are two tables: games (id, name, devices) and groped_games (id, game_id, group_name) . games.devices can store desktop or mobile . How games are stored in games:
1 loto desktop 2 loto mobile 3 soccer desktop 4 soccer mobile You need to replace groped_games.dame_id , where the corresponding games.devices = 'mobile' the id game with the same name, but where games.devices = 'desktop' . I started writing a query, but something came to a standstill:
UPDATE grouped_games SET games_id = (SELECT games_id FROM games WHERE #тут тупик)