这句SQL该怎么写才对
select a.id,a.xxx,b.yyy,b.addtime
from a,b
where b.fid=a.id
and b.fid in (select a.id from a,b where b.fid=a.id and datediff(day,b.nexttime,getdate())=0 order by b.addtime desc) order by b.addtime desc
出错地方在
b.fid in (select a.id from a,b where b.fid=a.id and datediff(day,b.nexttime,getdate())=0 order by b.addtime desc)
这一句该如何写
------解决方案--------------------select a.id,a.xxx,b.yyy,b.addtime
from a,b
where b.fid=a.id
and b.fid in (select a.id from a,b where b.fid=a.id and datediff(day,b.nexttime,getdate())=0)
order by b.addtime desc