USE [NewFlorist]
GO
/****** Object: StoredProcedure [dbo].[HomePageProducts] Script Date: 07/22/2010 16:28:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ProductPriceSearch]
@SiteID int,
@ID int
AS
BEGIN
SET NOCOUNT ON;
select
P.ID ProductiD,
P.ProductName,
P.ProductPhoto,
LEFT(P.ProductDescription, 44) +'...' ProductDescription,
S.Price
from dbo.Product P
inner join dbo.ProductSelect S
on S.ProductID = P.ID
where
P.FloristID = @SiteID
and P.HP = 'Y'
and S.PriceDescription = '1'
AND ( (@ID = 1 and S.Price < 25) or
(@ID = 2 and S.Price >= 25 and s.Price < 35) or
(@ID = 3 and S.Price between 35 and 50) or
(@ID = 4 and S.Price >= 50)
)
END
|