procedure to take most viewed products?
Microsoft Net Framework

USE [saudiphone]
GO
/***** Object:  StoredProcedure [dbo].[Product_LookUp_MostViewedProductList]    Script Date: 6/28/2018 2:10:16 PM *****/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create proc [dbo].[Product_LookUp_MostViewedProductList]
as
begin

select   Distinct Top (8) mv.ProductID, p.ProductTitle,p.Photo,p.MinPrice
,(select count(*) from RecentViewedProducts m where m.ProductId=mv.ProductId) as TotalCount from RecentViewedProducts mv
join Product p on p.ProductID = mv.ProductId 
ORDER BY TotalCount DESC

end

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM