有两个表,一表有字段name,dateandtime(格式为****-- ::**) 一表有一字段class 两表有一共同字段id
想输出时间在10天内的name字段的降序排列(前10个)和与之对应的class值??sql该怎么写?
谢谢!!!(ACCESS)
---------------------------------------------------------------
SELECT top 10 a.name,b.class
FROM t1 a,t2 b where a.id=b.id and DateDiff("d",dateandtime,now())<=10
order by a.name desc;