一、升序

--查询第20到第30条数据(升序,即从第20,21----30)(9=30-20+1)

1『数据库』MS数据操作select * from (select top 9* from (select top 30* from dbo.Student order by 学号 ascas a order by 学号 desc)as b order by 学号 asc

 

二、降序

--查询第20到第30条数据(降序,即从第30,29----20)

1『数据库』MS数据操作select top 9* from (select top 30* from dbo.Student order by 学号 ascas a order by 学号 desc 

 

三、多表取值

select * from

(

    select a.pid,a.pname,isnull(rates,0) rates,path,a.type from product a left outer join (

        select pid,sum(rates) rates from rate

        group by pid

    )b  on  a.pid=b.pid

) a where type=1

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2021-06-07
  • 2021-12-01
  • 2021-08-01
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2021-10-13
  • 2022-01-08
  • 2021-10-16
  • 2021-12-24
  • 2021-12-18
相关资源
相似解决方案