Hi Friends,
I have a small issue.I was writing one storeprocedure....
I have a table and on this I was writing couple of conditions.
Condition 1:
If three are mataching then display the records
Select * from Details
where Category=@Category and SubCat=@Subcat and Name=@Name
If above condition is fail or if no data in the table
then
Condition 2:
select * from detail
where Category=@Category or Subcat=@Subcat or Name=@Name (this is not perfect one what I need actually if category matches then display the records if not go Subcat if not go to Name)
Can anyone guide me how to do this ?
Thanks for your help