my $SQL1 = q{ SET @t_id:=(SELECT Team_ID FROM Teams WHERE Name='Boston'); SELECT * FROM Games WHERE Team_ID=@t_id AND Date>'2012-05-01'; };