2
ALTER PROCEDURE [dbo].[Sp_GetEmailForMailing]
-- Add the parameters for the stored procedure here
@end int=1000
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT top(500) RegistrationID, EmailID from dbo.Candidate_RegistrationData
where status_flag=1 and payment_status=2
and RegistrationID NOT IN (SELECT top(@end) RegistrationID from dbo.Candidate_RegistrationData
where status_flag=1 and payment_status=2) order by RegistrationID
END
这是我的存储过程。在这我想从500行,但我从250行号得到....任何人都知道为什么会发生......谢谢从SQL Server查询得不到正确的输出
你的意思是说,第一@end注册将被跳过?按登记ID升序排序? – Pankaj 2011-06-04 09:27:25