WITH query AS (select syusers0.id as id5, syusers0.createdatetime as createda25_, syusers0.modifydatetime as modifyda35_, syusers0.name as name5, syusers0.password as password5, ROW_NUMBER() OVER ( order by syusers0.name desc) as hibernaterow_nr from sypro.syuser syusers0_ where 1=1 ) SELECT * FROM query WHERE hibernaterownr >= 5 AND hibernaterownr 11
WITH AS短语,也叫做子查询部分(subquery factoring),可以让你做很多事情,定义一个SQL片断,该SQL片断会被整个SQL语句所用到。