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