USE [cms] GO /****** Object: StoredProcedure [dbo].[SpGetRelatedProducts] Script Date: 10/10/2012 14:35:39 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER proc [dbo].[SpGetRelatedProducts](@pid int) AS DECLARE @subcate int; select subcate_id as subcate from product where pid=@pid SELECT * FROM product where product.subcate_id=@subcate exec SpGetRelatedProducts 2
select * from product where subcate_id in (SELECT subcate_id FROM product where pid=@pid)
ALTER proc [dbo].[SpGetRelatedProducts](@pid int) AS SELECT * FROM product where product.pid=@pid
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)