• Without DDL and test data it is difficult to know what you want.

    Maybe you need to use the ROW_NUMBER() function like:

    SELECT *

    FROM

    (

    &nbsp&nbsp&nbsp&nbspSELECT ROW_NUMBER() OVER (PARTITION BY S.sessie_id ORDER BY S.created_date) AS Row

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp,S.*

    &nbsp&nbsp&nbsp&nbspFROM ideefiks.STM_SUBSCRIPTION S

    ) a

    &nbsp&nbsp&nbsp&nbspLEFT JOIN ideefiks.STM_SESSIE e

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspON a.sessie_id = e.id

    &nbsp&nbsp&nbsp&nbspLEFT JOIN ideefiks.STM_MEMBER c

    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspON a.member_id = c.id

    WHERE a.Row <= e.max_aantal_deelnemers

    ORDER BY a.created_date