求一条功能相同的sql语句....大侠们...着急啊! select *from dbo.View_ToExcel where 时间>='2012-01-01' and 时间<='2012-01-31' and 姓名 in ( select 姓名 from View_ToExcel where 时间>='2011-12-01' and 时间<='2011-12-31' )
------解决方案--------------------
SQL code
select a.*
from View_ToExcel a
join View_ToExcel b on a.姓名=b.姓名
where a.时间>='2012-01-01' and a.时间<='2012-01-31'
and b.时间>='2011-12-01' and b.时间<='2011-12-31'
------解决方案--------------------