AnsweredAssumed Answered

Fetch First语句中的with ties疑问。

Question asked by cyccyc621 on Jan 13, 2016
Latest reply on Jan 26, 2016 by Michael Leung

请教各位达人:

 

FileMaker的SQL参考里Fetch First里有个with ties,

格式为:

 

FETCH FIRST [ n [ PERCENT ] ] { ROWS | ROW } {ONLY | WITH TIES } ]


Reference的解释是:

 

WITH TIES allows more rows to be returned than specified in the FETCH count value because peer rows, those rows that are not distinct based on the ORDER BY clause, are also returned.


而Example里:

 

To return the ten rows and their peer rows (rows that are not distinct based on the ORDER BY clause):

  SELECT emp_id, last_name, first_name FROM emp ORDER BY last_name, first_name OFFSET 25 ROWS FETCH FIRST 10 ROWS WITH TIES 

 

 

 

 

想请教一下:with ties的作用是什么,peer rows又是什么含义。

Outcomes