1 回覆 最後回覆日期:Jan 26, 2016 5:40 AM,建立者:Michael Leung

    Fetch First语句中的with ties疑问。

    cyccyc621

      请教各位达人:

       

      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又是什么含义。