title: Subquery returned more than 1 value.This is not permitted when the subquery follows =,!=,<,<=,>,>= or when the subquery is used as an expression
body: <p>I have a stored procedure that <code>select * from book table</code> , using sub query my query is </p>
  
  <pre><code>USE [library]
  GO
  
  /****** Object:  StoredProcedure [dbo].[report_r_and_l]    Script Date: 04/17/2013 12:42:39 ******/
  
  SET ANSI_NULLS ON
  GO
  
  SET QUOTED_IDENTIFIER ON
  GO
  
  ALTER procedure [dbo].[report_r_and_l]
  @fdate date,
  @tdate date,
  @key varchar(1)
  as
  
  if(@key='r')
  
      select * 
      from dbo.books 
      where isbn =(select isbn from dbo.lending where (act between @fdate and @tdate) and (stat ='close'))
  
  else if(@key='l')
  
      select * 
      from dbo.books 
      where isbn =(select isbn from dbo.lending where lended_date between @fdate and @tdate)
  </code></pre>
  
  <p>I know sub query is return more than one query to main query , But i don't know how to avoid this error, can any one help me ?</p>