order by id DESC和order by id ASC
是字段id,降序和升序,DESC是从大到小,ASC是从小到大
这个语句的意思是
先查询books表一共的记录数select count(*)from books,比如得出的结果是a
然后根据id的降序查询出前a-2条记录的id。(select top((select count(*)from books)-2) id from books order by id DESC)
然后在这个范围内根据id的升序查询title,author,publishdate,isbn,unitprice字段,这个表的前两条记录,条件是ID在前面的范围之内。