USE pubs SET NOCOUNT ON GO DECLARE @pub_id char(4), @hire_date datetime SET @pub_id = '0877' SET @hire_date = '1/01/93' -- Here is the SELECT statement syntax to assign values to two local -- variables. -- SELECT @pub_id = '0877', @hire_date = '1/01/93' SET NOCOUNT OFF SELECT fname, lname FROM employee WHERE pub_id = @pub_id and hire_date >= @hire_date
下面是结果集:
fname lname -------------------- ------------------------------ Anabela Domingues Paul Henriot