ALTER TABLE `t1` ADD COLUMN `bid` VARCHAR(32) NOT NULL DEFAULT '' AFTER `id`;
UPDATE t1 AS s SET s.bid=(SELECT bid FROM t2 AS w WHERE w.id=s.id );
UPDATE t1 AS s SET s.bid=( IF((SELECT bid FROM t2 AS w WHERE w.id=s.id) IS NULL,"", (SELECT bid FROM t2 AS w WHERE w.id=s.id)));