DECLARE @lowpublishdate int, @highpublishdate int
SET @lowpublishdate=2002
SET @highpublishdate=2004SELECT * FROM bookInfo where year(publishdate) between @lowpublishdate and @highpublishdate
SET @lowpublishdate=2002
SET @highpublishdate=2004SELECT * FROM bookInfo where year(publishdate) between @lowpublishdate and @highpublishdate
SET @lowpublishdate=2002
SET @highpublishdate=2004
SELECT *FROM bookInfo where year(publishdate)>=@lowpublishdate and year(publishdate)<=@highpublishdate
SET @lowpublishdate=2002
SET @highpublishdate=2004
SELECT *FROM bookInfo where year(publishdate) between @lowpublishdate and @highpublishdate
小弟刚学sql。
再一次道一声谢谢了!!!!!!!!!!!!!!!!!!!!