求一条功能相同的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'
)
[解决办法]
select a.*from View_ToExcel ajoin 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'
[解决办法]