DECLARE @lowpublishdate int, @highpublishdate int
SET @lowpublishdate=2002
SET @highpublishdate=2004SELECT * FROM bookInfo where year(publishdate) between @lowpublishdate and @highpublishdate

解决方案 »

  1.   

    DECLARE @lowpublishdate int, @highpublishdate int            
    SET @lowpublishdate=2002
    SET @highpublishdate=2004
    SELECT *FROM bookInfo where year(publishdate)>=@lowpublishdate and year(publishdate)<=@highpublishdate
      

  2.   

    DECLARE @lowpublishdate int, @highpublishdate int            
    SET @lowpublishdate=2002
    SET @highpublishdate=2004
    SELECT *FROM bookInfo where year(publishdate) between @lowpublishdate and @highpublishdate
      

  3.   

    太感谢各位了,姑且称一声师兄或师姐。
    小弟刚学sql。
    再一次道一声谢谢了!!!!!!!!!!!!!!!!!!!!