Saturday, August 17, 2013

Update with select statement in SQL

UPDATE player
SET current_flag = ( SELECT CURRENT_FLAG FROM player WHERE
player_id = 1)
WHERE
player_id = 2

The above query will update current_flag field with current_flag of player_id = 2.


No comments:

Post a Comment