Minimum value within a set (or window) within a three column table
You could do this without the new (2012+) window function FIRST_VALUE(), using the ROW_NUMBER(). But you could also do it using  OUTER APPLY:

SELECT 
    d.CategorieID,
    IDMinOrder = a.ID,
    IDMaxOrder = b.ID
FROM 
    ( SELECT DISTINCT CategorieID 
      FROM tableX
    ) AS d
  OUTER APPLY 
    ( SELECT TOP (1) a.ID
      FROM tableX AS a
      WHERE a.CategorieID = d.CategorieID
      ORDER BY a."Order" ASC
    ) AS a
  OUTER APPLY 
    ( SELECT TOP (1) b.ID
      FROM tableX AS b
      WHERE b.CategorieID = d.CategorieID
      ORDER BY b."Order" Desc
    ) AS b ;