I want to Covert that Stored Procedure In Case Statement On in If Else
Please Help Me
CREATE PROCEDURE getlettestoffer(@offerid int)
As
Begin
Declare @offer varchar(50)
Select @offer=ImagePath from Offers where OfferID=@offerid
if @offer IS NOT NULL
Begin
Select TOP(10) Products.ProductID,Offers.OfferID,Offers.OfferTitle,Products.timestamp
from Products INNER JOIN Offers ON Products.ProductID=Offers.ProductID
where Offers.ImagePath is Not NULL order by timestamp desc
End
Else
Begin
Select TOP(10) Products.ProductID,Offers.OfferID,Offers.OfferTitle,Products.timestamp
from Products INNER JOIN Offers ON Products.ProductID=Offers.ProductID
order by timestamp desc
End
End
Any one help me to write this stored Procedure in case statement not in if Else statement
Convert Stored Procedure In to CASE STATEMENT Which is in IF ELSE
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Pankaj RanaRank #2,270 · 620 reputationPosted Dec 10, 2011, 7:53 PM EST
CREATE PROCEDURE getlettestoffer(@offerid int)